Files
cloudflare-domain-manager/packages/db/migrations/004_service_groups.sql
T
Denozordec d11414666f
Build, Test, and Push CFDM Docker Image / test (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / create-release (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been cancelled
Refactor project to transition from Rust backend to Node.js with Fastify; update Dockerfile and Docker configurations for new build process; enhance local development instructions in CONTRIBUTING.md; implement health checks in Docker Compose; update pnpm-lock.yaml with new dependencies for API and shared packages; revise README.md to reflect new stack and development setup.
2026-06-19 12:06:32 +07:00

30 lines
958 B
SQL

PRAGMA foreign_keys = OFF;
CREATE TABLE service_groups (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
type TEXT NOT NULL DEFAULT 'custom',
icon TEXT,
domain TEXT,
enabled INTEGER NOT NULL DEFAULT 1,
created_at TEXT NOT NULL DEFAULT (datetime('now')),
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
);
ALTER TABLE services ADD COLUMN service_group_id INTEGER REFERENCES service_groups(id) ON DELETE SET NULL;
ALTER TABLE services ADD COLUMN subdomain TEXT;
ALTER TABLE services ADD COLUMN enabled INTEGER NOT NULL DEFAULT 0;
UPDATE services SET subdomain = slug WHERE subdomain IS NULL;
INSERT INTO service_groups (name, type, enabled) VALUES
('VPN', 'vpn', 1),
('Сеть', 'network', 1),
('Интернет', 'internet', 1);
UPDATE services
SET service_group_id = (SELECT id FROM service_groups WHERE type = 'vpn' LIMIT 1)
WHERE slug IN ('vpn-panel', 'vpn-node');
PRAGMA foreign_keys = ON;