-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1342 from andrew-bierman/generate-prod-migration
Generate a production migration
- Loading branch information
Showing
3 changed files
with
1,559 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE `item_pack_templates` ( | ||
`item_id` text, | ||
`pack_template_id` text, | ||
`quantity` integer DEFAULT 1 NOT NULL, | ||
PRIMARY KEY(`item_id`, `pack_template_id`), | ||
FOREIGN KEY (`item_id`) REFERENCES `item`(`id`) ON UPDATE no action ON DELETE cascade, | ||
FOREIGN KEY (`pack_template_id`) REFERENCES `pack_template`(`id`) ON UPDATE no action ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE `pack_template` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`name` text NOT NULL, | ||
`description` text NOT NULL, | ||
`type` text DEFAULT 'packTemplate' | ||
); | ||
--> statement-breakpoint | ||
ALTER TABLE item_packs ADD `quantity` integer DEFAULT 1 NOT NULL;--> statement-breakpoint | ||
ALTER TABLE `item` DROP COLUMN `quantity`; |
Oops, something went wrong.