feat: integrate editor record for snapshots

This commit is contained in:
DarkSky
2024-08-19 16:02:46 +08:00
parent f5f5b05a4c
commit 7901a55fd7
5 changed files with 38 additions and 19 deletions
@@ -1,19 +1,12 @@
/*
Warnings:
- Added the required column `created_by` to the `snapshot_histories` table without a default value. This is not possible if the table is not empty.
- Added the required column `created_by` to the `updates` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "snapshot_histories" ADD COLUMN "created_by" VARCHAR NOT NULL;
ALTER TABLE "snapshot_histories" ADD COLUMN "created_by" VARCHAR;
-- AlterTable
ALTER TABLE "snapshots" ADD COLUMN "created_by" VARCHAR,
ADD COLUMN "updated_by" VARCHAR;
-- AlterTable
ALTER TABLE "updates" ADD COLUMN "created_by" VARCHAR NOT NULL;
ALTER TABLE "updates" ADD COLUMN "created_by" VARCHAR NOT NULL DEFAULT 'system';
-- AddForeignKey
ALTER TABLE "snapshots" ADD CONSTRAINT "snapshots_created_by_fkey" FOREIGN KEY ("created_by") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;