mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-02 18:02:20 +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,23 @@
|
||||
-- +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;
|
||||
Reference in New Issue
Block a user