Files
mkd/backend/migrate_company_settings.sql
2026-02-04 00:17:04 +05:00

23 lines
1.1 KiB
SQL
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- ========= НАСТРОЙКИ КОМПАНИИ =========
-- Данные о компании для отчетов жителям
CREATE TABLE IF NOT EXISTS company_settings (
id BIGSERIAL PRIMARY KEY,
name TEXT NOT NULL DEFAULT 'Управляющая компания',
full_name TEXT,
address TEXT,
phone TEXT,
email TEXT,
website TEXT,
license_number TEXT,
license_valid_until DATE,
logo_url TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Вставляем дефолтные данные, если их нет
INSERT INTO company_settings (id, name, full_name, address, phone, email, license_number)
VALUES (1, 'Управляющая компания "Дружба"', 'ООО "Управляющая компания Дружба"', 'г. Уфа, ул. Ленина, 1', '+7 (347) 123-45-67', 'info@uk-druzhba.ru', 'Лицензия №12345')
ON CONFLICT (id) DO NOTHING;