mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-14 07:55:13 +00:00
feat: Add comprehensive database schema migrations for all platform tables
- Add subscribers table with IMSI, MSISDN, authentication keys, and eSIM profile fields - Add service_plans table for data/voice/SMS limits and QoS parameters (ARPA, AMBR) - Add sessions table for tracking PDU sessions with QoS and usage metrics - Add usage_records table for billing and charging data - Add users table with role-based access control fields - Add roles, permissions, and role_permissions junction table for RBAC - Add auth
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
-- +goose Up
|
||||
-- Create deployment_records table
|
||||
CREATE TABLE IF NOT EXISTS deployment_records (
|
||||
id SERIAL PRIMARY KEY,
|
||||
service TEXT NOT NULL,
|
||||
version TEXT NOT NULL,
|
||||
environment TEXT,
|
||||
status TEXT NOT NULL,
|
||||
strategy TEXT,
|
||||
replicas INTEGER NOT NULL DEFAULT 1,
|
||||
triggered_by TEXT,
|
||||
reason TEXT,
|
||||
started_at TIMESTAMPTZ,
|
||||
completed_at TIMESTAMPTZ,
|
||||
rollback_to TEXT,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Create indexes
|
||||
CREATE INDEX IF NOT EXISTS idx_deployment_records_service ON deployment_records(service);
|
||||
CREATE INDEX IF NOT EXISTS idx_deployment_records_environment ON deployment_records(environment);
|
||||
CREATE INDEX IF NOT EXISTS idx_deployment_records_status ON deployment_records(status);
|
||||
CREATE INDEX IF NOT EXISTS idx_deployment_records_created_at ON deployment_records(created_at);
|
||||
|
||||
-- +goose Down
|
||||
-- Drop deployment_records table
|
||||
DROP TABLE IF EXISTS deployment_records CASCADE;
|
||||
Reference in New Issue
Block a user