From c85d21c262d8cd67cb507f76c735c6d84f2573c4 Mon Sep 17 00:00:00 2001 From: Mathew Morris Date: Thu, 8 Feb 2024 14:25:53 -0600 Subject: [PATCH] baseline db --- .../migration.sql | 18 +++++++++++++++ .../migration.sql | 23 ------------------- .../migration.sql | 11 --------- prisma/migrations/migration_lock.toml | 3 --- 4 files changed, 18 insertions(+), 37 deletions(-) rename prisma/migrations/{20231221073641_initial => 0_init}/migration.sql (78%) delete mode 100644 prisma/migrations/20231221073818_add_card_table/migration.sql delete mode 100644 prisma/migrations/20240208062759_allow_seeding_to_card_table/migration.sql delete mode 100644 prisma/migrations/migration_lock.toml diff --git a/prisma/migrations/20231221073641_initial/migration.sql b/prisma/migrations/0_init/migration.sql similarity index 78% rename from prisma/migrations/20231221073641_initial/migration.sql rename to prisma/migrations/0_init/migration.sql index 2f3899a..696625e 100644 --- a/prisma/migrations/20231221073641_initial/migration.sql +++ b/prisma/migrations/0_init/migration.sql @@ -1,6 +1,23 @@ +-- CreateTable +CREATE TABLE `cards` ( + `id` VARCHAR(191) NOT NULL, + `name` TEXT NOT NULL, + `scryfall_id` VARCHAR(191) NOT NULL, + `scryfall_uri` TEXT NOT NULL, + `image_status` TEXT NOT NULL, + `image_uris` JSON NULL, + `layout` TEXT NOT NULL, + + UNIQUE INDEX `cards_scryfall_id_key`(`scryfall_id`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + -- CreateTable CREATE TABLE `Collection` ( `id` VARCHAR(191) NOT NULL, + `userId` VARCHAR(191) NOT NULL, + `name` VARCHAR(191) NOT NULL DEFAULT 'My Collection', + `description` VARCHAR(191) NOT NULL, `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `updatedAt` DATETIME(3) NOT NULL, @@ -59,3 +76,4 @@ CREATE TABLE `VerificationToken` ( UNIQUE INDEX `VerificationToken_token_key`(`token`), UNIQUE INDEX `VerificationToken_identifier_token_key`(`identifier`, `token`) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + diff --git a/prisma/migrations/20231221073818_add_card_table/migration.sql b/prisma/migrations/20231221073818_add_card_table/migration.sql deleted file mode 100644 index 3ba9fad..0000000 --- a/prisma/migrations/20231221073818_add_card_table/migration.sql +++ /dev/null @@ -1,23 +0,0 @@ -/* - Warnings: - - - Added the required column `description` to the `Collection` table without a default value. This is not possible if the table is not empty. - - Added the required column `userId` to the `Collection` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE `Collection` ADD COLUMN `description` VARCHAR(191) NOT NULL, - ADD COLUMN `name` VARCHAR(191) NOT NULL DEFAULT 'My Collection', - ADD COLUMN `userId` VARCHAR(191) NOT NULL; - --- CreateTable -CREATE TABLE `Card` ( - `id` VARCHAR(191) NOT NULL, - `name` TEXT NOT NULL, - `scryfall_id` TEXT NOT NULL, - `scryfall_uri` TEXT NOT NULL, - `image_status` TEXT NOT NULL, - `layout` TEXT NOT NULL, - - PRIMARY KEY (`id`) -) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; diff --git a/prisma/migrations/20240208062759_allow_seeding_to_card_table/migration.sql b/prisma/migrations/20240208062759_allow_seeding_to_card_table/migration.sql deleted file mode 100644 index 4c244d4..0000000 --- a/prisma/migrations/20240208062759_allow_seeding_to_card_table/migration.sql +++ /dev/null @@ -1,11 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[scryfall_id]` on the table `Card` will be added. If there are existing duplicate values, this will fail. - -*/ --- AlterTable -ALTER TABLE `Card` MODIFY `scryfall_id` VARCHAR(191) NOT NULL; - --- CreateIndex -CREATE UNIQUE INDEX `Card_scryfall_id_key` ON `Card`(`scryfall_id`); diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml deleted file mode 100644 index e5a788a..0000000 --- a/prisma/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) -provider = "mysql" \ No newline at end of file