Files
ppanel-web/migrations/postgres/02121_user_withdrawal.sql
T
Ember Moth 2744c70c5c Initial
2026-07-05 20:27:58 +08:00

24 lines
855 B
SQL

-- migrate:up
CREATE TABLE IF NOT EXISTS "withdrawals" (
"id" BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"user_id" BIGINT NOT NULL,
"amount" BIGINT NOT NULL,
"content" TEXT,
"status" SMALLINT NOT NULL DEFAULT 0,
"reason" VARCHAR(500) NOT NULL DEFAULT '',
"created_at" TIMESTAMP NOT NULL,
"updated_at" TIMESTAMP NOT NULL,
PRIMARY KEY ("id")
);
CREATE INDEX IF NOT EXISTS "withdrawals_idx_user_id" ON "withdrawals" ("user_id");
INSERT INTO "system" ("category", "key", "value", "type", "desc", "created_at", "updated_at")
VALUES
('invite', 'WithdrawalMethod', '', 'string', 'withdrawal method', '2025-04-22 14:25:16.637', '2025-04-22 14:25:16.637') ON CONFLICT DO NOTHING;
-- migrate:down
DROP TABLE IF EXISTS "withdrawals";
DELETE FROM "system"
WHERE "category" = 'invite'
AND "key" = 'WithdrawalMethod';