Skip to content

Commit

Permalink
Merge pull request #1342 from andrew-bierman/generate-prod-migration
Browse files Browse the repository at this point in the history
Generate a production migration
  • Loading branch information
taronaleksanian authored Dec 3, 2024
2 parents 5730968 + 7f39286 commit c51c675
Show file tree
Hide file tree
Showing 3 changed files with 1,559 additions and 0 deletions.
18 changes: 18 additions & 0 deletions server/migrations/0007_wealthy_next_avengers.sql
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`;
Loading

0 comments on commit c51c675

Please sign in to comment.