mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 02:52:53 +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
24 lines
748 B
SQL
24 lines
748 B
SQL
-- +goose Up
|
|
-- Create payment_methods table
|
|
CREATE TABLE IF NOT EXISTS payment_methods (
|
|
id TEXT PRIMARY KEY,
|
|
subscriber_id INTEGER NOT NULL,
|
|
gateway_id TEXT,
|
|
type TEXT NOT NULL,
|
|
customer_id TEXT,
|
|
last4 TEXT,
|
|
brand TEXT,
|
|
expiry_month INTEGER,
|
|
expiry_year INTEGER,
|
|
is_default BOOLEAN NOT NULL DEFAULT false,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
-- Create indexes
|
|
CREATE INDEX IF NOT EXISTS idx_payment_methods_subscriber_id ON payment_methods(subscriber_id);
|
|
CREATE INDEX IF NOT EXISTS idx_payment_methods_gateway_id ON payment_methods(gateway_id);
|
|
|
|
-- +goose Down
|
|
-- Drop payment_methods table
|
|
DROP TABLE IF EXISTS payment_methods CASCADE;
|