Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Warnings:

- A unique constraint covering the columns `[account_name]` on the table `users` will be added. If there are existing duplicate values, this will fail.

*/
-- AlterTable
ALTER TABLE "users" ADD COLUMN "account_name" TEXT NOT NULL DEFAULT gen_random_uuid();

-- CreateIndex
CREATE UNIQUE INDEX "users_account_name_key" ON "users"("account_name");
1 change: 1 addition & 0 deletions packages/db-main-prisma/prisma/postgres/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ model User {
salt String?
phone String? @unique
email String @unique
accountName String @default(uuid()) @unique @map("account_name")
avatar String?
isSystem Boolean? @map("is_system")
isAdmin Boolean? @map("is_admin")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Warnings:

- A unique constraint covering the columns `[account_name]` on the table `users` will be added. If there are existing duplicate values, this will fail.

*/
-- AlterTable
ALTER TABLE "users" ADD COLUMN "account_name" TEXT NOT NULL DEFAULT (lower(hex(randomblob(16))));

-- CreateIndex
CREATE UNIQUE INDEX "users_account_name_key" ON "users"("account_name");
1 change: 1 addition & 0 deletions packages/db-main-prisma/prisma/sqlite/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ model User {
salt String?
phone String? @unique
email String @unique
accountName String @default(uuid()) @unique @map("account_name")
avatar String?
isSystem Boolean? @map("is_system")
isAdmin Boolean? @map("is_admin")
Expand Down
1 change: 1 addition & 0 deletions packages/db-main-prisma/prisma/template.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ model User {
salt String?
phone String? @unique
email String @unique
accountName String @default(uuid()) @unique @map("account_name")
avatar String?
isSystem Boolean? @map("is_system")
isAdmin Boolean? @map("is_admin")
Expand Down