mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
fix(server): created user in update table should not have defualt value (#8134)
This commit is contained in:
@@ -6,7 +6,7 @@ ALTER TABLE "snapshots" ADD COLUMN "created_by" VARCHAR,
|
||||
ADD COLUMN "updated_by" VARCHAR;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "updates" ADD COLUMN "created_by" VARCHAR DEFAULT 'system';
|
||||
ALTER TABLE "updates" ADD COLUMN "created_by" VARCHAR;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "snapshots" ADD CONSTRAINT "snapshots_created_by_fkey" FOREIGN KEY ("created_by") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
@@ -286,8 +286,7 @@ model Update {
|
||||
id String @map("guid") @db.VarChar
|
||||
blob Bytes @db.ByteA
|
||||
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
||||
// TODO(@darkskygit): fullfill old update, remove default value in next release
|
||||
createdBy String? @default("system") @map("created_by") @db.VarChar
|
||||
createdBy String? @map("created_by") @db.VarChar
|
||||
|
||||
// will delete createor record if createor's account is deleted
|
||||
createdByUser User? @relation(name: "createdUpdate", fields: [createdBy], references: [id], onDelete: SetNull)
|
||||
|
||||
Reference in New Issue
Block a user