turash/bugulma/backend/migrations/postgres/019_create_system_settings_table.up.sql
2025-12-15 10:06:41 +01:00

11 lines
437 B
SQL
Executable File

-- Migration: 019_create_system_settings_table.up.sql
-- Create a system_settings table to store key-value settings such as maintenance mode
CREATE TABLE IF NOT EXISTS system_settings (
key TEXT PRIMARY KEY,
value JSONB NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT now()
);
-- Add an index on updated_at for efficient queries
CREATE INDEX IF NOT EXISTS idx_system_settings_updated_at ON system_settings(updated_at DESC);