Files
backend/database/migrations/007_domain_expiry_active.sql
Ali Reza bb59d5e9ba Initial commit: Meshkee CMS API
NestJS backend with Prisma, Docker Compose for Postgres/Redis, and deploy docs for the production VM.
2026-07-21 17:52:36 +03:30

10 lines
300 B
SQL

ALTER TABLE domains
ADD COLUMN IF NOT EXISTS expires_at TIMESTAMPTZ,
ADD COLUMN IF NOT EXISTS is_active BOOLEAN NOT NULL DEFAULT TRUE;
CREATE INDEX IF NOT EXISTS idx_domains_is_active ON domains (is_active);
UPDATE domains
SET expires_at = NOW() + INTERVAL '365 days'
WHERE expires_at IS NULL;