Files
telecom-platform/migrations/00016_init_payment_methods.sql
nutcas3 e6450f15ad 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
2026-04-29 03:25:28 +03:00

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;