mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-28 15:42:16 +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,30 @@
|
||||
-- +goose Up
|
||||
-- Create plugins table
|
||||
CREATE TABLE IF NOT EXISTS plugins (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name TEXT NOT NULL UNIQUE,
|
||||
version TEXT NOT NULL,
|
||||
description TEXT,
|
||||
author TEXT,
|
||||
type TEXT,
|
||||
category TEXT,
|
||||
license TEXT,
|
||||
homepage TEXT,
|
||||
repository TEXT,
|
||||
enabled BOOLEAN NOT NULL DEFAULT false,
|
||||
status TEXT NOT NULL DEFAULT 'installed',
|
||||
config JSONB,
|
||||
installed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
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_plugins_name ON plugins(name);
|
||||
CREATE INDEX IF NOT EXISTS idx_plugins_enabled ON plugins(enabled);
|
||||
CREATE INDEX IF NOT EXISTS idx_plugins_deleted_at ON plugins(deleted_at);
|
||||
|
||||
-- +goose Down
|
||||
-- Drop plugins table
|
||||
DROP TABLE IF EXISTS plugins CASCADE;
|
||||
Reference in New Issue
Block a user