-- Migration: add pre_planting_sell_restriction_overrides table
-- [2026-03-04] 新增：预种卖出限制管理员手动解除记录表
--
-- 用途：管理员手动解除某用户的预种卖出限制时，写入此表。
-- 判断逻辑：isRestricted = has_pre_planting_marker AND !has_real_tree AND !admin_override
CREATE TABLE "pre_planting_sell_restriction_overrides" (
  "account_sequence" VARCHAR(20)  NOT NULL,
  "unlocked_by"      VARCHAR(50)  NOT NULL,
  "reason"           VARCHAR(200),
  "created_at"       TIMESTAMPTZ  NOT NULL DEFAULT now(),
  CONSTRAINT "pre_planting_sell_restriction_overrides_pkey" PRIMARY KEY ("account_sequence")
);
