mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-12 15:05:14 +00:00
feat: Add goose database migrations for rating_plans and esim_profiles tables
- Create 00001_init_rating_plans.sql migration with rating_plans table schema - Add plan_id, name, rate fields (data/voice/sms), monthly_fee, and limit fields (data/voice/sms) - Include is_active flag and timestamp fields (created_at, updated_at) - Add indexes on is_active and created_at columns - Create 00002_init_esim_profiles.sql migration with esim_profiles table schema - Add iccid (primary key), eid, imsi, mcc, mnc, profile_
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- +goose Up
|
||||
-- Create esim_profiles table
|
||||
CREATE TABLE IF NOT EXISTS esim_profiles (
|
||||
iccid TEXT PRIMARY KEY,
|
||||
eid TEXT,
|
||||
imsi TEXT,
|
||||
mcc TEXT,
|
||||
mnc TEXT,
|
||||
profile_type TEXT,
|
||||
state TEXT,
|
||||
tenant_id TEXT,
|
||||
activation_code TEXT,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Create indexes
|
||||
CREATE INDEX IF NOT EXISTS idx_esim_profiles_eid ON esim_profiles(eid);
|
||||
CREATE INDEX IF NOT EXISTS idx_esim_profiles_imsi ON esim_profiles(imsi);
|
||||
CREATE INDEX IF NOT EXISTS idx_esim_profiles_state ON esim_profiles(state);
|
||||
CREATE INDEX IF NOT EXISTS idx_esim_profiles_tenant_id ON esim_profiles(tenant_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_esim_profiles_created_at ON esim_profiles(created_at);
|
||||
|
||||
-- +goose Down
|
||||
-- Drop esim_profiles table
|
||||
DROP TABLE IF EXISTS esim_profiles CASCADE;
|
||||
Reference in New Issue
Block a user