Skip to content

Commit

Permalink
snake_case table columns
Browse files Browse the repository at this point in the history
  • Loading branch information
sadmann7 committed Jan 22, 2024
1 parent d1267e2 commit a6251b5
Show file tree
Hide file tree
Showing 22 changed files with 7,374 additions and 29 deletions.
42 changes: 42 additions & 0 deletions drizzle/0038_melted_tempest.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ALTER TABLE `addresses` RENAME COLUMN `postalCode` TO `postal_code`;--> statement-breakpoint
ALTER TABLE `addresses` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `addresses` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `paymentIntentId` TO `payment_intent_id`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `clientSecret` TO `client_secret`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `email_preferences` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `email_preferences` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `storeId` TO `store_id`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `stripePaymentIntentId` TO `stripe_payment_intent_id`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `stripePaymentIntentStatus` TO `stripe_payment_intent_status`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `addressId` TO `address_id`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `stripeAccountId` TO `stripe_account_id`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `stripeAccountCreatedAt` TO `stripe_account_created_at`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `stripeAccountExpiresAt` TO `stripe_account_expires_at`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `detailsSubmitted` TO `details_submitted`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `storeId` TO `store_id`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `userId` TO `user_id`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `stripeAccountId` TO `stripe_account_id`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `addresses` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `addresses` MODIFY COLUMN `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `carts` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `carts` MODIFY COLUMN `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `email_preferences` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `email_preferences` MODIFY COLUMN `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `orders` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `orders` MODIFY COLUMN `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `payments` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `payments` MODIFY COLUMN `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `products` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `products` MODIFY COLUMN `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `stores` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `stores` MODIFY COLUMN `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP;
9 changes: 9 additions & 0 deletions drizzle/0039_brainy_prowler.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ALTER TABLE `payments` RENAME COLUMN `storeId` TO `store_id`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `store_id` TO `storeId`;--> statement-breakpoint
ALTER TABLE `addresses` MODIFY COLUMN `updated_at` timestamp ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `carts` MODIFY COLUMN `updated_at` timestamp ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `email_preferences` MODIFY COLUMN `updated_at` timestamp ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `orders` MODIFY COLUMN `updated_at` timestamp ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `payments` MODIFY COLUMN `updated_at` timestamp ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `products` MODIFY COLUMN `updated_at` timestamp ON UPDATE CURRENT_TIMESTAMP;--> statement-breakpoint
ALTER TABLE `stores` MODIFY COLUMN `updated_at` timestamp ON UPDATE CURRENT_TIMESTAMP;
34 changes: 34 additions & 0 deletions drizzle/0040_right_malcolm_colcord.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ALTER TABLE `addresses` RENAME COLUMN `postal_code` TO `postalCode`;--> statement-breakpoint
ALTER TABLE `addresses` RENAME COLUMN `created_at` TO `createdAt`;--> statement-breakpoint
ALTER TABLE `addresses` RENAME COLUMN `updated_at` TO `updatedAt`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `payment_intent_id` TO `paymentIntentId`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `client_secret` TO `clientSecret`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `created_at` TO `createdAt`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `updated_at` TO `updatedAt`;--> statement-breakpoint
ALTER TABLE `email_preferences` RENAME COLUMN `created_at` TO `createdAt`;--> statement-breakpoint
ALTER TABLE `email_preferences` RENAME COLUMN `updated_at` TO `updatedAt`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `store_id` TO `storeId`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `stripe_payment_intent_id` TO `stripePaymentIntentId`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `stripe_payment_intent_status` TO `stripePaymentIntentStatus`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `address_id` TO `addressId`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `created_at` TO `createdAt`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `updated_at` TO `updatedAt`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `store_id` TO `storeId`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `stripe_account_id` TO `stripeAccountId`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `stripe_account_created_at` TO `stripeAccountCreatedAt`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `stripe_account_expires_at` TO `stripeAccountExpiresAt`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `details_submitted` TO `detailsSubmitted`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `created_at` TO `createdAt`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `updated_at` TO `updatedAt`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `created_at` TO `createdAt`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `updated_at` TO `updatedAt`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `user_id` TO `userId`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `stripe_account_id` TO `stripeAccountId`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `created_at` TO `createdAt`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `updated_at` TO `updatedAt`;--> statement-breakpoint
ALTER TABLE `addresses` MODIFY COLUMN `createdAt` timestamp DEFAULT (now());--> statement-breakpoint
ALTER TABLE `carts` MODIFY COLUMN `createdAt` timestamp DEFAULT (now());--> statement-breakpoint
ALTER TABLE `email_preferences` MODIFY COLUMN `createdAt` timestamp DEFAULT (now());--> statement-breakpoint
ALTER TABLE `orders` MODIFY COLUMN `createdAt` timestamp DEFAULT (now());--> statement-breakpoint
ALTER TABLE `payments` MODIFY COLUMN `createdAt` timestamp DEFAULT (now());--> statement-breakpoint
ALTER TABLE `products` MODIFY COLUMN `createdAt` timestamp DEFAULT (now());
20 changes: 20 additions & 0 deletions drizzle/0041_luxuriant_thanos.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ALTER TABLE `addresses` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `addresses` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `email_preferences` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `email_preferences` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `createdAt` TO `created_at`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `updatedAt` TO `updated_at`;--> statement-breakpoint
ALTER TABLE `addresses` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `carts` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `email_preferences` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `orders` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `payments` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());--> statement-breakpoint
ALTER TABLE `products` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());
3 changes: 3 additions & 0 deletions drizzle/0042_wandering_pete_wisdom.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE `stores` RENAME COLUMN `userId` TO `user_id`;--> statement-breakpoint
ALTER TABLE `stores` RENAME COLUMN `stripeAccountId` TO `stripe_account_id`;--> statement-breakpoint
ALTER TABLE `stores` ADD CONSTRAINT `stores_user_id_unique` UNIQUE(`user_id`);
1 change: 1 addition & 0 deletions drizzle/0043_chilly_power_pack.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `stores` DROP INDEX `stores_user_id_unique`;
3 changes: 3 additions & 0 deletions drizzle/0044_sour_bushwacker.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE `carts` RENAME COLUMN `paymentIntentId` TO `payment_intent_id`;--> statement-breakpoint
ALTER TABLE `carts` RENAME COLUMN `clientSecret` TO `client_secret`;--> statement-breakpoint
ALTER TABLE `products` RENAME COLUMN `storeId` TO `store_id`;
2 changes: 2 additions & 0 deletions drizzle/0045_right_sunset_bain.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE `addresses` RENAME COLUMN `postalCode` TO `postal_code`;--> statement-breakpoint
ALTER TABLE `email_preferences` RENAME COLUMN `userId` TO `user_id`;
4 changes: 4 additions & 0 deletions drizzle/0046_wonderful_stepford_cuckoos.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE `payments` RENAME COLUMN `stripeAccountId` TO `stripe_account_id`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `stripeAccountCreatedAt` TO `stripe_account_created_at`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `stripeAccountExpiresAt` TO `stripe_account_expires_at`;--> statement-breakpoint
ALTER TABLE `payments` RENAME COLUMN `detailsSubmitted` TO `details_submitted`;
4 changes: 4 additions & 0 deletions drizzle/0047_cooing_blob.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE `orders` RENAME COLUMN `storeId` TO `store_id`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `stripePaymentIntentId` TO `stripe_payment_intent_id`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `stripePaymentIntentStatus` TO `stripe_payment_intent_status`;--> statement-breakpoint
ALTER TABLE `orders` RENAME COLUMN `addressId` TO `address_id`;
Loading

0 comments on commit a6251b5

Please sign in to comment.