Scert/backend/internal/database/migrations/sqlite/0027_dns_accounts.sql
xuans 02e039984a 保存 DNS 多账户数据层与实库故障夹具修复前检查点
基础模型和迁移已完成;增量竞态暴露 MySQL 审计故障注入权限问题,后续修复,不代表完整功能或验收通过。
2026-10-04 04:42:39 +08:00

16 lines
572 B
SQL

CREATE TABLE dns_accounts (
id TEXT NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
project_id TEXT NOT NULL REFERENCES projects(id) ON DELETE RESTRICT,
owner_user_id TEXT NOT NULL,
provider TEXT NOT NULL,
credential_ref TEXT NOT NULL,
status TEXT NOT NULL,
verification_state TEXT NOT NULL,
revision INTEGER NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL
);
CREATE UNIQUE INDEX uq_dns_accounts_credential ON dns_accounts (credential_ref);
CREATE INDEX idx_dns_accounts_project ON dns_accounts (project_id, id);