refactor(contribution): 合并所有迁移到 0001_init
- 将 0002_add_soft_delete 的 deleted_at 字段合并到 0001_init - 删除 0002_add_soft_delete_to_system_contribution_records 目录 - 现在只保留一个初始化迁移文件 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
21c6c25f7c
commit
f7dbe2f62b
|
|
@ -257,6 +257,8 @@ CREATE TABLE "system_contribution_records" (
|
||||||
"effective_date" DATE NOT NULL,
|
"effective_date" DATE NOT NULL,
|
||||||
"expire_date" DATE,
|
"expire_date" DATE,
|
||||||
"is_expired" BOOLEAN NOT NULL DEFAULT false,
|
"is_expired" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
-- 软删除时间戳
|
||||||
|
"deleted_at" TIMESTAMP(3),
|
||||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
|
||||||
CONSTRAINT "system_contribution_records_pkey" PRIMARY KEY ("id")
|
CONSTRAINT "system_contribution_records_pkey" PRIMARY KEY ("id")
|
||||||
|
|
@ -265,6 +267,7 @@ CREATE TABLE "system_contribution_records" (
|
||||||
CREATE INDEX "system_contribution_records_system_account_id_idx" ON "system_contribution_records"("system_account_id");
|
CREATE INDEX "system_contribution_records_system_account_id_idx" ON "system_contribution_records"("system_account_id");
|
||||||
CREATE INDEX "system_contribution_records_source_adoption_id_idx" ON "system_contribution_records"("source_adoption_id");
|
CREATE INDEX "system_contribution_records_source_adoption_id_idx" ON "system_contribution_records"("source_adoption_id");
|
||||||
CREATE INDEX "system_contribution_records_source_type_idx" ON "system_contribution_records"("source_type");
|
CREATE INDEX "system_contribution_records_source_type_idx" ON "system_contribution_records"("source_type");
|
||||||
|
CREATE INDEX "system_contribution_records_deleted_at_idx" ON "system_contribution_records"("deleted_at");
|
||||||
|
|
||||||
ALTER TABLE "system_contribution_records" ADD CONSTRAINT "system_contribution_records_system_account_id_fkey" FOREIGN KEY ("system_account_id") REFERENCES "system_accounts"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
ALTER TABLE "system_contribution_records" ADD CONSTRAINT "system_contribution_records_system_account_id_fkey" FOREIGN KEY ("system_account_id") REFERENCES "system_accounts"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
-- AlterTable: Add soft delete column to system_contribution_records
|
|
||||||
ALTER TABLE "system_contribution_records" ADD COLUMN "deleted_at" TIMESTAMP(3);
|
|
||||||
|
|
||||||
-- CreateIndex
|
|
||||||
CREATE INDEX "system_contribution_records_deleted_at_idx" ON "system_contribution_records"("deleted_at");
|
|
||||||
Loading…
Reference in New Issue