Files
FamilyHUB/backend/migrations/000002_create_families.up.sql
T
admin 9d845c8899 Restructured project
- backend moved to backend directory
- added and initialized frontend with vue
- moved infrastructure files to infra directory
2026-04-01 23:16:27 +03:00

14 lines
499 B
SQL

CREATE TABLE families
(
id BIGSERIAL PRIMARY KEY,
name TEXT NOT NULL,
owner_id BIGINT NOT NULL REFERENCES users (id),
telegram_chat_id BIGINT NOT NULL,
telegram_chat_name TEXT,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_families_owner_id ON families (owner_id);
CREATE UNIQUE INDEX idx_families_chat_id ON families (telegram_chat_id);