mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
add uuid to account
This commit is contained in:
parent
d4abe51331
commit
adb0a06006
3 changed files with 26 additions and 8 deletions
12
db/postgresql/migrations/04_account_uuid/migration.sql
Normal file
12
db/postgresql/migrations/04_account_uuid/migration.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
-- AlterTable
|
||||
ALTER TABLE "account" ADD COLUMN "account_uuid" UUID NULL;
|
||||
|
||||
-- Backfill UUID
|
||||
UPDATE "account" SET account_uuid = gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "account" ALTER COLUMN "account_uuid" SET 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())
|
||||
username String @unique @db.VarChar(255)
|
||||
password String @db.VarChar(60)
|
||||
is_admin Boolean @default(false)
|
||||
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
||||
updated_at DateTime? @default(now()) @db.Timestamptz(6)
|
||||
website website[]
|
||||
user_id Int @id @default(autoincrement())
|
||||
username String @unique @db.VarChar(255)
|
||||
password String @db.VarChar(60)
|
||||
is_admin Boolean @default(false)
|
||||
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
||||
updated_at DateTime? @default(now()) @db.Timestamptz(6)
|
||||
account_uuid String @unique @db.Uuid
|
||||
website website[]
|
||||
}
|
||||
|
||||
model event {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue