File tree Expand file tree Collapse file tree 5 files changed +25
-0
lines changed
packages/db-main-prisma/prisma
migrations/20251105051609_add_users_account_name
migrations/20251105051541_add_users_account_name Expand file tree Collapse file tree 5 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ Warnings:
3+
4+ - A unique constraint covering the columns `[account_name]` on the table `users` will be added. If there are existing duplicate values, this will fail.
5+
6+ */
7+ -- AlterTable
8+ ALTER TABLE " users" ADD COLUMN " account_name" TEXT NOT NULL DEFAULT gen_random_uuid();
9+
10+ -- CreateIndex
11+ CREATE UNIQUE INDEX "users_account_name_key " ON " users" (" account_name" );
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ model User {
181181 salt String ?
182182 phone String ? @unique
183183 email String @unique
184+ accountName String @default (uuid () ) @unique @map (" account_name " )
184185 avatar String ?
185186 isSystem Boolean ? @map (" is_system " )
186187 isAdmin Boolean ? @map (" is_admin " )
Original file line number Diff line number Diff line change 1+ /*
2+ Warnings:
3+
4+ - A unique constraint covering the columns `[account_name]` on the table `users` will be added. If there are existing duplicate values, this will fail.
5+
6+ */
7+ -- AlterTable
8+ ALTER TABLE " users" ADD COLUMN " account_name" TEXT NOT NULL DEFAULT (lower (hex(randomblob(16 ))));
9+
10+ -- CreateIndex
11+ CREATE UNIQUE INDEX "users_account_name_key " ON " users" (" account_name" );
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ model User {
181181 salt String ?
182182 phone String ? @unique
183183 email String @unique
184+ accountName String @default (uuid () ) @unique @map (" account_name " )
184185 avatar String ?
185186 isSystem Boolean ? @map (" is_system " )
186187 isAdmin Boolean ? @map (" is_admin " )
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ model User {
181181 salt String ?
182182 phone String ? @unique
183183 email String @unique
184+ accountName String @default (uuid () ) @unique @map (" account_name " )
184185 avatar String ?
185186 isSystem Boolean ? @map (" is_system " )
186187 isAdmin Boolean ? @map (" is_admin " )
You can’t perform that action at this time.
0 commit comments