mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 19:12:54 +00:00
- 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
29 lines
866 B
SQL
29 lines
866 B
SQL
-- +goose Up
|
|
-- Create service_plans table
|
|
CREATE TABLE IF NOT EXISTS service_plans (
|
|
id SERIAL PRIMARY KEY,
|
|
name TEXT NOT NULL,
|
|
description TEXT,
|
|
data_limit BIGINT,
|
|
voice_limit INTEGER,
|
|
sms_limit INTEGER,
|
|
monthly_fee DOUBLE PRECISION,
|
|
data_rate DOUBLE PRECISION,
|
|
voice_rate DOUBLE PRECISION,
|
|
sms_rate DOUBLE PRECISION,
|
|
arpa INTEGER,
|
|
ambr_uplink INTEGER,
|
|
ambr_downlink INTEGER,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
deleted_at TIMESTAMPTZ
|
|
);
|
|
|
|
-- Create indexes
|
|
CREATE INDEX IF NOT EXISTS idx_service_plans_name ON service_plans(name);
|
|
CREATE INDEX IF NOT EXISTS idx_service_plans_deleted_at ON service_plans(deleted_at);
|
|
|
|
-- +goose Down
|
|
-- Drop service_plans table
|
|
DROP TABLE IF EXISTS service_plans CASCADE;
|