fix(mining-service): 添加 ManualMiningRecord 缺失的 migration 0004

schema 中定义的 manual_mining_records 表缺少对应的 migration 文件,
导致 schema 与 migration 不一致。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-29 22:30:04 -08:00
parent 534d4ce70c
commit a41feb841f
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
-- CreateTable
CREATE TABLE "manual_mining_records" (
"id" TEXT NOT NULL,
"account_sequence" TEXT NOT NULL,
"adoption_date" DATE NOT NULL,
"effective_date" DATE NOT NULL,
"execute_date" TIMESTAMP(3) NOT NULL,
"total_seconds" BIGINT NOT NULL,
"user_contribution" DECIMAL(30,8) NOT NULL,
"network_contribution" DECIMAL(30,8) NOT NULL,
"second_distribution" DECIMAL(30,18) NOT NULL,
"contribution_ratio" DECIMAL(30,18) NOT NULL,
"amount" DECIMAL(30,8) NOT NULL,
"operator_id" TEXT NOT NULL,
"operator_name" TEXT NOT NULL,
"reason" TEXT NOT NULL,
"wallet_synced" BOOLEAN NOT NULL DEFAULT false,
"wallet_synced_at" TIMESTAMP(3),
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "manual_mining_records_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "manual_mining_records_account_sequence_key" ON "manual_mining_records"("account_sequence");
-- CreateIndex
CREATE INDEX "manual_mining_records_operator_id_idx" ON "manual_mining_records"("operator_id");
-- CreateIndex
CREATE INDEX "manual_mining_records_wallet_synced_idx" ON "manual_mining_records"("wallet_synced");
-- CreateIndex
CREATE INDEX "manual_mining_records_created_at_idx" ON "manual_mining_records"("created_at" DESC);