|
|
|
|
@@ -1,9 +1,10 @@
|
|
|
|
|
/* SQLEditor (MySQL (2))*/
|
|
|
|
|
|
|
|
|
|
SET FOREIGN_KEY_CHECKS=0;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS account_static_ips;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS account_limits;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS account_products;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS account_subscriptions;
|
|
|
|
|
@@ -14,30 +15,46 @@ DROP TABLE IF EXISTS call_routes;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS dns_records;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS lcr;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS lcr_carrier_set_entry;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS lcr_routes;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS password_settings;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS user_permissions;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS permissions;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS predefined_sip_gateways;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS predefined_smpp_gateways;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS predefined_carriers;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS account_offers;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS products;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS schema_version;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS api_keys;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS sbc_addresses;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS ms_teams_tenants;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS service_provider_limits;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS signup_history;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS smpp_addresses;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS speech_credentials;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS system_information;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS users;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS smpp_gateways;
|
|
|
|
|
@@ -65,6 +82,15 @@ private_ipv4 VARBINARY(16) NOT NULL UNIQUE ,
|
|
|
|
|
PRIMARY KEY (account_static_ip_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE account_limits
|
|
|
|
|
(
|
|
|
|
|
account_limits_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
account_sid CHAR(36) NOT NULL,
|
|
|
|
|
category ENUM('api_rate','voice_call_session', 'device','voice_call_minutes','voice_call_session_license', 'voice_call_minutes_license') NOT NULL,
|
|
|
|
|
quantity INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (account_limits_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE account_subscriptions
|
|
|
|
|
(
|
|
|
|
|
account_subscription_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
@@ -113,11 +139,38 @@ PRIMARY KEY (dns_record_sid)
|
|
|
|
|
CREATE TABLE lcr_routes
|
|
|
|
|
(
|
|
|
|
|
lcr_route_sid CHAR(36),
|
|
|
|
|
lcr_sid CHAR(36) NOT NULL,
|
|
|
|
|
regex VARCHAR(32) NOT NULL COMMENT 'regex-based pattern match against dialed number, used for LCR routing of PSTN calls',
|
|
|
|
|
description VARCHAR(1024),
|
|
|
|
|
priority INTEGER NOT NULL UNIQUE COMMENT 'lower priority routes are attempted first',
|
|
|
|
|
priority INTEGER NOT NULL COMMENT 'lower priority routes are attempted first',
|
|
|
|
|
PRIMARY KEY (lcr_route_sid)
|
|
|
|
|
) COMMENT='Least cost routing table';
|
|
|
|
|
) COMMENT='An ordered list of digit patterns in an LCR table. The patterns are tested in sequence until one matches';
|
|
|
|
|
|
|
|
|
|
CREATE TABLE lcr
|
|
|
|
|
(
|
|
|
|
|
lcr_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
name VARCHAR(64) COMMENT 'User-assigned name for this LCR table',
|
|
|
|
|
is_active BOOLEAN NOT NULL DEFAULT 1,
|
|
|
|
|
default_carrier_set_entry_sid CHAR(36) COMMENT 'default carrier/route to use when no digit match based results are found.',
|
|
|
|
|
service_provider_sid CHAR(36),
|
|
|
|
|
account_sid CHAR(36),
|
|
|
|
|
PRIMARY KEY (lcr_sid)
|
|
|
|
|
) COMMENT='An LCR (least cost routing) table that is used by a service provider or account to make decisions about routing outbound calls when multiple carriers are available.';
|
|
|
|
|
|
|
|
|
|
CREATE TABLE password_settings
|
|
|
|
|
(
|
|
|
|
|
min_password_length INTEGER NOT NULL DEFAULT 8,
|
|
|
|
|
require_digit BOOLEAN NOT NULL DEFAULT false,
|
|
|
|
|
require_special_character BOOLEAN NOT NULL DEFAULT false
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE permissions
|
|
|
|
|
(
|
|
|
|
|
permission_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
name VARCHAR(32) NOT NULL UNIQUE ,
|
|
|
|
|
description VARCHAR(255),
|
|
|
|
|
PRIMARY KEY (permission_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE predefined_carriers
|
|
|
|
|
(
|
|
|
|
|
@@ -148,6 +201,20 @@ predefined_carrier_sid CHAR(36) NOT NULL,
|
|
|
|
|
PRIMARY KEY (predefined_sip_gateway_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE predefined_smpp_gateways
|
|
|
|
|
(
|
|
|
|
|
predefined_smpp_gateway_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
ipv4 VARCHAR(128) NOT NULL COMMENT 'ip address or DNS name of the gateway. ',
|
|
|
|
|
port INTEGER NOT NULL DEFAULT 2775 COMMENT 'smpp signaling port',
|
|
|
|
|
inbound BOOLEAN NOT NULL COMMENT 'if true, whitelist this IP to allow inbound SMS from the gateway',
|
|
|
|
|
outbound BOOLEAN NOT NULL COMMENT 'i',
|
|
|
|
|
netmask INTEGER NOT NULL DEFAULT 32,
|
|
|
|
|
is_primary BOOLEAN NOT NULL DEFAULT 1,
|
|
|
|
|
use_tls BOOLEAN DEFAULT 0,
|
|
|
|
|
predefined_carrier_sid CHAR(36) NOT NULL,
|
|
|
|
|
PRIMARY KEY (predefined_smpp_gateway_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE products
|
|
|
|
|
(
|
|
|
|
|
product_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
@@ -174,6 +241,11 @@ stripe_product_id VARCHAR(56) NOT NULL,
|
|
|
|
|
PRIMARY KEY (account_offer_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE schema_version
|
|
|
|
|
(
|
|
|
|
|
version VARCHAR(16)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE api_keys
|
|
|
|
|
(
|
|
|
|
|
api_key_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
@@ -191,7 +263,10 @@ CREATE TABLE sbc_addresses
|
|
|
|
|
sbc_address_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
ipv4 VARCHAR(255) NOT NULL,
|
|
|
|
|
port INTEGER NOT NULL DEFAULT 5060,
|
|
|
|
|
tls_port INTEGER,
|
|
|
|
|
wss_port INTEGER,
|
|
|
|
|
service_provider_sid CHAR(36),
|
|
|
|
|
last_updated DATETIME,
|
|
|
|
|
PRIMARY KEY (sbc_address_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@@ -205,6 +280,15 @@ tenant_fqdn VARCHAR(255) NOT NULL UNIQUE ,
|
|
|
|
|
PRIMARY KEY (ms_teams_tenant_sid)
|
|
|
|
|
) COMMENT='A Microsoft Teams customer tenant';
|
|
|
|
|
|
|
|
|
|
CREATE TABLE service_provider_limits
|
|
|
|
|
(
|
|
|
|
|
service_provider_limits_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
service_provider_sid CHAR(36) NOT NULL,
|
|
|
|
|
category ENUM('api_rate','voice_call_session', 'device','voice_call_minutes','voice_call_session_license', 'voice_call_minutes_license') NOT NULL,
|
|
|
|
|
quantity INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (service_provider_limits_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE signup_history
|
|
|
|
|
(
|
|
|
|
|
email VARCHAR(255) NOT NULL,
|
|
|
|
|
@@ -241,6 +325,13 @@ created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
|
PRIMARY KEY (speech_credential_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE system_information
|
|
|
|
|
(
|
|
|
|
|
domain_name VARCHAR(255),
|
|
|
|
|
sip_domain_name VARCHAR(255),
|
|
|
|
|
monitoring_domain_name VARCHAR(255)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE users
|
|
|
|
|
(
|
|
|
|
|
user_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
@@ -260,6 +351,7 @@ email_activation_code VARCHAR(16),
|
|
|
|
|
email_validated BOOLEAN NOT NULL DEFAULT false,
|
|
|
|
|
phone_validated BOOLEAN NOT NULL DEFAULT false,
|
|
|
|
|
email_content_opt_out BOOLEAN NOT NULL DEFAULT false,
|
|
|
|
|
is_active BOOLEAN NOT NULL DEFAULT true,
|
|
|
|
|
PRIMARY KEY (user_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@@ -287,9 +379,21 @@ smpp_password VARCHAR(64),
|
|
|
|
|
smpp_enquire_link_interval INTEGER DEFAULT 0,
|
|
|
|
|
smpp_inbound_system_id VARCHAR(255),
|
|
|
|
|
smpp_inbound_password VARCHAR(64),
|
|
|
|
|
register_from_user VARCHAR(128),
|
|
|
|
|
register_from_domain VARCHAR(255),
|
|
|
|
|
register_public_ip_in_contact BOOLEAN NOT NULL DEFAULT false,
|
|
|
|
|
register_status VARCHAR(4096),
|
|
|
|
|
PRIMARY KEY (voip_carrier_sid)
|
|
|
|
|
) COMMENT='A Carrier or customer PBX that can send or receive calls';
|
|
|
|
|
|
|
|
|
|
CREATE TABLE user_permissions
|
|
|
|
|
(
|
|
|
|
|
user_permissions_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
user_sid CHAR(36) NOT NULL,
|
|
|
|
|
permission_sid CHAR(36) NOT NULL,
|
|
|
|
|
PRIMARY KEY (user_permissions_sid)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE smpp_gateways
|
|
|
|
|
(
|
|
|
|
|
smpp_gateway_sid CHAR(36) NOT NULL UNIQUE ,
|
|
|
|
|
@@ -307,7 +411,7 @@ PRIMARY KEY (smpp_gateway_sid)
|
|
|
|
|
CREATE TABLE phone_numbers
|
|
|
|
|
(
|
|
|
|
|
phone_number_sid CHAR(36) UNIQUE ,
|
|
|
|
|
number VARCHAR(32) NOT NULL UNIQUE ,
|
|
|
|
|
number VARCHAR(132) NOT NULL UNIQUE ,
|
|
|
|
|
voip_carrier_sid CHAR(36),
|
|
|
|
|
account_sid CHAR(36),
|
|
|
|
|
application_sid CHAR(36),
|
|
|
|
|
@@ -325,6 +429,7 @@ inbound BOOLEAN NOT NULL COMMENT 'if true, whitelist this IP to allow inbound ca
|
|
|
|
|
outbound BOOLEAN NOT NULL COMMENT 'if true, include in least-cost routing when placing calls to the PSTN',
|
|
|
|
|
voip_carrier_sid CHAR(36) NOT NULL,
|
|
|
|
|
is_active BOOLEAN NOT NULL DEFAULT 1,
|
|
|
|
|
protocol ENUM('udp','tcp','tls', 'tls/srtp') DEFAULT 'udp' COMMENT 'Outbound call protocol',
|
|
|
|
|
PRIMARY KEY (sip_gateway_sid)
|
|
|
|
|
) COMMENT='A whitelisted sip gateway used for origination/termination';
|
|
|
|
|
|
|
|
|
|
@@ -357,6 +462,7 @@ account_sid CHAR(36) COMMENT 'account that this application belongs to (if null,
|
|
|
|
|
call_hook_sid CHAR(36) COMMENT 'webhook to call for inbound calls ',
|
|
|
|
|
call_status_hook_sid CHAR(36) COMMENT 'webhook to call for call status events',
|
|
|
|
|
messaging_hook_sid CHAR(36) COMMENT 'webhook to call for inbound SMS/MMS ',
|
|
|
|
|
app_json TEXT,
|
|
|
|
|
speech_synthesis_vendor VARCHAR(64) NOT NULL DEFAULT 'google',
|
|
|
|
|
speech_synthesis_language VARCHAR(12) NOT NULL DEFAULT 'en-US',
|
|
|
|
|
speech_synthesis_voice VARCHAR(64),
|
|
|
|
|
@@ -395,6 +501,11 @@ disable_cdrs BOOLEAN NOT NULL DEFAULT 0,
|
|
|
|
|
trial_end_date DATETIME,
|
|
|
|
|
deactivated_reason VARCHAR(255),
|
|
|
|
|
device_to_call_ratio INTEGER NOT NULL DEFAULT 5,
|
|
|
|
|
subspace_client_id VARCHAR(255),
|
|
|
|
|
subspace_client_secret VARCHAR(255),
|
|
|
|
|
subspace_sip_teleport_id VARCHAR(255),
|
|
|
|
|
subspace_sip_teleport_destinations VARCHAR(255),
|
|
|
|
|
siprec_hook_sid CHAR(36),
|
|
|
|
|
PRIMARY KEY (account_sid)
|
|
|
|
|
) COMMENT='An enterprise that uses the platform for comm services';
|
|
|
|
|
|
|
|
|
|
@@ -402,24 +513,40 @@ CREATE INDEX account_static_ip_sid_idx ON account_static_ips (account_static_ip_
|
|
|
|
|
CREATE INDEX account_sid_idx ON account_static_ips (account_sid);
|
|
|
|
|
ALTER TABLE account_static_ips ADD FOREIGN KEY account_sid_idxfk (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX account_sid_idx ON account_limits (account_sid);
|
|
|
|
|
ALTER TABLE account_limits ADD FOREIGN KEY account_sid_idxfk_1 (account_sid) REFERENCES accounts (account_sid) ON DELETE CASCADE;
|
|
|
|
|
|
|
|
|
|
CREATE INDEX account_subscription_sid_idx ON account_subscriptions (account_subscription_sid);
|
|
|
|
|
CREATE INDEX account_sid_idx ON account_subscriptions (account_sid);
|
|
|
|
|
ALTER TABLE account_subscriptions ADD FOREIGN KEY account_sid_idxfk_1 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE account_subscriptions ADD FOREIGN KEY account_sid_idxfk_2 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX invite_code_idx ON beta_invite_codes (invite_code);
|
|
|
|
|
CREATE INDEX call_route_sid_idx ON call_routes (call_route_sid);
|
|
|
|
|
ALTER TABLE call_routes ADD FOREIGN KEY account_sid_idxfk_2 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE call_routes ADD FOREIGN KEY account_sid_idxfk_3 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE call_routes ADD FOREIGN KEY application_sid_idxfk (application_sid) REFERENCES applications (application_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX dns_record_sid_idx ON dns_records (dns_record_sid);
|
|
|
|
|
ALTER TABLE dns_records ADD FOREIGN KEY account_sid_idxfk_3 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE dns_records ADD FOREIGN KEY account_sid_idxfk_4 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX lcr_sid_idx ON lcr_routes (lcr_sid);
|
|
|
|
|
ALTER TABLE lcr_routes ADD FOREIGN KEY lcr_sid_idxfk (lcr_sid) REFERENCES lcr (lcr_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX lcr_sid_idx ON lcr (lcr_sid);
|
|
|
|
|
ALTER TABLE lcr ADD FOREIGN KEY default_carrier_set_entry_sid_idxfk (default_carrier_set_entry_sid) REFERENCES lcr_carrier_set_entry (lcr_carrier_set_entry_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON lcr (service_provider_sid);
|
|
|
|
|
CREATE INDEX account_sid_idx ON lcr (account_sid);
|
|
|
|
|
CREATE INDEX permission_sid_idx ON permissions (permission_sid);
|
|
|
|
|
CREATE INDEX predefined_carrier_sid_idx ON predefined_carriers (predefined_carrier_sid);
|
|
|
|
|
CREATE INDEX predefined_sip_gateway_sid_idx ON predefined_sip_gateways (predefined_sip_gateway_sid);
|
|
|
|
|
CREATE INDEX predefined_carrier_sid_idx ON predefined_sip_gateways (predefined_carrier_sid);
|
|
|
|
|
ALTER TABLE predefined_sip_gateways ADD FOREIGN KEY predefined_carrier_sid_idxfk (predefined_carrier_sid) REFERENCES predefined_carriers (predefined_carrier_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX predefined_smpp_gateway_sid_idx ON predefined_smpp_gateways (predefined_smpp_gateway_sid);
|
|
|
|
|
CREATE INDEX predefined_carrier_sid_idx ON predefined_smpp_gateways (predefined_carrier_sid);
|
|
|
|
|
ALTER TABLE predefined_smpp_gateways ADD FOREIGN KEY predefined_carrier_sid_idxfk_1 (predefined_carrier_sid) REFERENCES predefined_carriers (predefined_carrier_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX product_sid_idx ON products (product_sid);
|
|
|
|
|
CREATE INDEX account_product_sid_idx ON account_products (account_product_sid);
|
|
|
|
|
CREATE INDEX account_subscription_sid_idx ON account_products (account_subscription_sid);
|
|
|
|
|
@@ -429,14 +556,14 @@ ALTER TABLE account_products ADD FOREIGN KEY product_sid_idxfk (product_sid) REF
|
|
|
|
|
|
|
|
|
|
CREATE INDEX account_offer_sid_idx ON account_offers (account_offer_sid);
|
|
|
|
|
CREATE INDEX account_sid_idx ON account_offers (account_sid);
|
|
|
|
|
ALTER TABLE account_offers ADD FOREIGN KEY account_sid_idxfk_4 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE account_offers ADD FOREIGN KEY account_sid_idxfk_5 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX product_sid_idx ON account_offers (product_sid);
|
|
|
|
|
ALTER TABLE account_offers ADD FOREIGN KEY product_sid_idxfk_1 (product_sid) REFERENCES products (product_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX api_key_sid_idx ON api_keys (api_key_sid);
|
|
|
|
|
CREATE INDEX account_sid_idx ON api_keys (account_sid);
|
|
|
|
|
ALTER TABLE api_keys ADD FOREIGN KEY account_sid_idxfk_5 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE api_keys ADD FOREIGN KEY account_sid_idxfk_6 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON api_keys (service_provider_sid);
|
|
|
|
|
ALTER TABLE api_keys ADD FOREIGN KEY service_provider_sid_idxfk (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
@@ -450,44 +577,53 @@ ALTER TABLE sbc_addresses ADD FOREIGN KEY service_provider_sid_idxfk_1 (service_
|
|
|
|
|
CREATE INDEX ms_teams_tenant_sid_idx ON ms_teams_tenants (ms_teams_tenant_sid);
|
|
|
|
|
ALTER TABLE ms_teams_tenants ADD FOREIGN KEY service_provider_sid_idxfk_2 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ms_teams_tenants ADD FOREIGN KEY account_sid_idxfk_6 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE ms_teams_tenants ADD FOREIGN KEY account_sid_idxfk_7 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ms_teams_tenants ADD FOREIGN KEY application_sid_idxfk_1 (application_sid) REFERENCES applications (application_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX tenant_fqdn_idx ON ms_teams_tenants (tenant_fqdn);
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON service_provider_limits (service_provider_sid);
|
|
|
|
|
ALTER TABLE service_provider_limits ADD FOREIGN KEY service_provider_sid_idxfk_3 (service_provider_sid) REFERENCES service_providers (service_provider_sid) ON DELETE CASCADE;
|
|
|
|
|
|
|
|
|
|
CREATE INDEX email_idx ON signup_history (email);
|
|
|
|
|
CREATE INDEX smpp_address_sid_idx ON smpp_addresses (smpp_address_sid);
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON smpp_addresses (service_provider_sid);
|
|
|
|
|
ALTER TABLE smpp_addresses ADD FOREIGN KEY service_provider_sid_idxfk_3 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
ALTER TABLE smpp_addresses ADD FOREIGN KEY service_provider_sid_idxfk_4 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX speech_credentials_idx_1 ON speech_credentials (vendor,account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX speech_credential_sid_idx ON speech_credentials (speech_credential_sid);
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON speech_credentials (service_provider_sid);
|
|
|
|
|
ALTER TABLE speech_credentials ADD FOREIGN KEY service_provider_sid_idxfk_4 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
ALTER TABLE speech_credentials ADD FOREIGN KEY service_provider_sid_idxfk_5 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX account_sid_idx ON speech_credentials (account_sid);
|
|
|
|
|
ALTER TABLE speech_credentials ADD FOREIGN KEY account_sid_idxfk_7 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE speech_credentials ADD FOREIGN KEY account_sid_idxfk_8 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX user_sid_idx ON users (user_sid);
|
|
|
|
|
CREATE INDEX email_idx ON users (email);
|
|
|
|
|
CREATE INDEX phone_idx ON users (phone);
|
|
|
|
|
CREATE INDEX account_sid_idx ON users (account_sid);
|
|
|
|
|
ALTER TABLE users ADD FOREIGN KEY account_sid_idxfk_8 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE users ADD FOREIGN KEY account_sid_idxfk_9 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON users (service_provider_sid);
|
|
|
|
|
ALTER TABLE users ADD FOREIGN KEY service_provider_sid_idxfk_5 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
ALTER TABLE users ADD FOREIGN KEY service_provider_sid_idxfk_6 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX email_activation_code_idx ON users (email_activation_code);
|
|
|
|
|
CREATE INDEX voip_carrier_sid_idx ON voip_carriers (voip_carrier_sid);
|
|
|
|
|
CREATE INDEX account_sid_idx ON voip_carriers (account_sid);
|
|
|
|
|
ALTER TABLE voip_carriers ADD FOREIGN KEY account_sid_idxfk_9 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE voip_carriers ADD FOREIGN KEY account_sid_idxfk_10 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON voip_carriers (service_provider_sid);
|
|
|
|
|
ALTER TABLE voip_carriers ADD FOREIGN KEY service_provider_sid_idxfk_6 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
ALTER TABLE voip_carriers ADD FOREIGN KEY service_provider_sid_idxfk_7 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE voip_carriers ADD FOREIGN KEY application_sid_idxfk_2 (application_sid) REFERENCES applications (application_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX user_permissions_sid_idx ON user_permissions (user_permissions_sid);
|
|
|
|
|
CREATE INDEX user_sid_idx ON user_permissions (user_sid);
|
|
|
|
|
ALTER TABLE user_permissions ADD FOREIGN KEY user_sid_idxfk (user_sid) REFERENCES users (user_sid) ON DELETE CASCADE;
|
|
|
|
|
|
|
|
|
|
ALTER TABLE user_permissions ADD FOREIGN KEY permission_sid_idxfk (permission_sid) REFERENCES permissions (permission_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX smpp_gateway_sid_idx ON smpp_gateways (smpp_gateway_sid);
|
|
|
|
|
CREATE INDEX voip_carrier_sid_idx ON smpp_gateways (voip_carrier_sid);
|
|
|
|
|
ALTER TABLE smpp_gateways ADD FOREIGN KEY voip_carrier_sid_idxfk (voip_carrier_sid) REFERENCES voip_carriers (voip_carrier_sid);
|
|
|
|
|
@@ -497,12 +633,12 @@ CREATE INDEX number_idx ON phone_numbers (number);
|
|
|
|
|
CREATE INDEX voip_carrier_sid_idx ON phone_numbers (voip_carrier_sid);
|
|
|
|
|
ALTER TABLE phone_numbers ADD FOREIGN KEY voip_carrier_sid_idxfk_1 (voip_carrier_sid) REFERENCES voip_carriers (voip_carrier_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE phone_numbers ADD FOREIGN KEY account_sid_idxfk_10 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE phone_numbers ADD FOREIGN KEY account_sid_idxfk_11 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE phone_numbers ADD FOREIGN KEY application_sid_idxfk_3 (application_sid) REFERENCES applications (application_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON phone_numbers (service_provider_sid);
|
|
|
|
|
ALTER TABLE phone_numbers ADD FOREIGN KEY service_provider_sid_idxfk_7 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
ALTER TABLE phone_numbers ADD FOREIGN KEY service_provider_sid_idxfk_8 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX sip_gateway_idx_hostport ON sip_gateways (ipv4,port);
|
|
|
|
|
|
|
|
|
|
@@ -518,10 +654,10 @@ CREATE UNIQUE INDEX applications_idx_name ON applications (account_sid,name);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX application_sid_idx ON applications (application_sid);
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON applications (service_provider_sid);
|
|
|
|
|
ALTER TABLE applications ADD FOREIGN KEY service_provider_sid_idxfk_8 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
ALTER TABLE applications ADD FOREIGN KEY service_provider_sid_idxfk_9 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX account_sid_idx ON applications (account_sid);
|
|
|
|
|
ALTER TABLE applications ADD FOREIGN KEY account_sid_idxfk_11 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
ALTER TABLE applications ADD FOREIGN KEY account_sid_idxfk_12 (account_sid) REFERENCES accounts (account_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE applications ADD FOREIGN KEY call_hook_sid_idxfk (call_hook_sid) REFERENCES webhooks (webhook_sid);
|
|
|
|
|
|
|
|
|
|
@@ -537,7 +673,7 @@ ALTER TABLE service_providers ADD FOREIGN KEY registration_hook_sid_idxfk (regis
|
|
|
|
|
CREATE INDEX account_sid_idx ON accounts (account_sid);
|
|
|
|
|
CREATE INDEX sip_realm_idx ON accounts (sip_realm);
|
|
|
|
|
CREATE INDEX service_provider_sid_idx ON accounts (service_provider_sid);
|
|
|
|
|
ALTER TABLE accounts ADD FOREIGN KEY service_provider_sid_idxfk_9 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
ALTER TABLE accounts ADD FOREIGN KEY service_provider_sid_idxfk_10 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE accounts ADD FOREIGN KEY registration_hook_sid_idxfk_1 (registration_hook_sid) REFERENCES webhooks (webhook_sid);
|
|
|
|
|
|
|
|
|
|
@@ -545,4 +681,6 @@ ALTER TABLE accounts ADD FOREIGN KEY queue_event_hook_sid_idxfk (queue_event_hoo
|
|
|
|
|
|
|
|
|
|
ALTER TABLE accounts ADD FOREIGN KEY device_calling_application_sid_idxfk (device_calling_application_sid) REFERENCES applications (application_sid);
|
|
|
|
|
|
|
|
|
|
ALTER TABLE accounts ADD FOREIGN KEY siprec_hook_sid_idxfk (siprec_hook_sid) REFERENCES applications (application_sid);
|
|
|
|
|
|
|
|
|
|
SET FOREIGN_KEY_CHECKS=1;
|
|
|
|
|
|