-- CreateTable: Debezium Heartbeat
-- 用于 CDC replication slot 的 WAL 位置推进
-- 由 Debezium heartbeat.action.query 自动更新
-- 防止因业务表长期无写入导致 WAL 堆积

CREATE TABLE "debezium_heartbeat" (
    "id" INTEGER NOT NULL DEFAULT 1,
    "ts" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

    CONSTRAINT "debezium_heartbeat_pkey" PRIMARY KEY ("id")
);

-- 插入初始记录
INSERT INTO "debezium_heartbeat" ("id", "ts") VALUES (1, NOW());
