This commit is contained in:
2025-11-08 15:06:30 +08:00
parent 27614f695f
commit e28e885e66
14 changed files with 99 additions and 78 deletions

View File

@@ -1,5 +1,5 @@
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
registrations_remaining INTEGER DEFAULT 3,
@@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS invite_codes (
code VARCHAR(32) UNIQUE NOT NULL,
created_by INTEGER REFERENCES users(id),
used_by INTEGER REFERENCES users(id),
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
used_at TIMESTAMPTZ
);
@@ -57,7 +57,7 @@ CREATE TABLE IF NOT EXISTS dns_records (
value VARCHAR(1000) NOT NULL,
ttl INTEGER DEFAULT 3600,
priority INTEGER, -- For MX records
created_at TIMESTAMPTZ DEFAULT NOW()
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_dns_records_domain_type ON dns_records(domain_id, record_type);