mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
add mysql changes
This commit is contained in:
parent
adb0a06006
commit
6de634f0b4
2 changed files with 19 additions and 7 deletions
11
db/mysql/migrations/04_account_uuid/migration.sql
Normal file
11
db/mysql/migrations/04_account_uuid/migration.sql
Normal 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`);
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue