mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +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;
|
ADD COLUMN "updated_by" VARCHAR;
|
||||||
|
|
||||||
-- AlterTable
|
-- AlterTable
|
||||||
ALTER TABLE "updates" ADD COLUMN "created_by" VARCHAR DEFAULT 'system';
|
ALTER TABLE "updates" ADD COLUMN "created_by" VARCHAR;
|
||||||
|
|
||||||
-- AddForeignKey
|
-- AddForeignKey
|
||||||
ALTER TABLE "snapshots" ADD CONSTRAINT "snapshots_created_by_fkey" FOREIGN KEY ("created_by") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
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
|
id String @map("guid") @db.VarChar
|
||||||
blob Bytes @db.ByteA
|
blob Bytes @db.ByteA
|
||||||
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
||||||
// TODO(@darkskygit): fullfill old update, remove default value in next release
|
createdBy String? @map("created_by") @db.VarChar
|
||||||
createdBy String? @default("system") @map("created_by") @db.VarChar
|
|
||||||
|
|
||||||
// will delete createor record if createor's account is deleted
|
// will delete createor record if createor's account is deleted
|
||||||
createdByUser User? @relation(name: "createdUpdate", fields: [createdBy], references: [id], onDelete: SetNull)
|
createdByUser User? @relation(name: "createdUpdate", fields: [createdBy], references: [id], onDelete: SetNull)
|
||||||
|
|||||||
Reference in New Issue
Block a user