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

@ -8,13 +8,14 @@ datasource db {
}
model account {
user_id Int @id @default(autoincrement()) @db.UnsignedInt
username String @unique() @db.VarChar(255)
password String @db.VarChar(60)
is_admin Boolean @default(false)
created_at DateTime? @default(now()) @db.Timestamp(0)
updated_at DateTime? @default(now()) @db.Timestamp(0)
website website[]
user_id Int @id @default(autoincrement()) @db.UnsignedInt
username String @unique() @db.VarChar(255)
password String @db.VarChar(60)
is_admin Boolean @default(false)
created_at DateTime? @default(now()) @db.Timestamp(0)
updated_at DateTime? @default(now()) @db.Timestamp(0)
account_uuid String @unique() @db.VarChar(36)
website website[]
}
model event {