add mysql changes

This commit is contained in:
Brian Cao 2022-10-02 20:42:32 -07:00
parent adb0a06006
commit 6de634f0b4
2 changed files with 19 additions and 7 deletions

View File

@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE `account` ADD COLUMN `account_uuid` VARCHAR(36);
-- Backfill UUID
UPDATE `account` SET account_uuid=(SELECT uuid());
-- AlterTable
ALTER TABLE `account` MODIFY `account_uuid` VARCHAR(36) NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX `account_account_uuid_key` ON `account`(`account_uuid`);

View File

@ -14,6 +14,7 @@ model account {
is_admin Boolean @default(false) is_admin Boolean @default(false)
created_at DateTime? @default(now()) @db.Timestamp(0) created_at DateTime? @default(now()) @db.Timestamp(0)
updated_at DateTime? @default(now()) @db.Timestamp(0) updated_at DateTime? @default(now()) @db.Timestamp(0)
account_uuid String @unique() @db.VarChar(36)
website website[] website website[]
} }