;
CREATE TABLE "ipypbxweb_domain" (
"id" integer NOT NULL PRIMARY KEY,
+ "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
"sip_profile_id" integer NOT NULL REFERENCES "ipypbxweb_sipprofile" ("id"),
"host_name" varchar(100) NOT NULL,
"is_active" bool NOT NULL
;
CREATE TABLE "ipypbxweb_gateway" (
"id" integer NOT NULL PRIMARY KEY,
+ "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
"sip_profile_id" integer NOT NULL REFERENCES "ipypbxweb_sipprofile" ("id"),
"name" varchar(100) NOT NULL,
"username" varchar(100) NOT NULL,
;
CREATE TABLE "ipypbxweb_endpoint" (
"id" integer NOT NULL PRIMARY KEY,
+ "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
"user_id" varchar(100) NOT NULL,
"password" varchar(100) NOT NULL,
"domain_id" integer NOT NULL REFERENCES "ipypbxweb_domain" ("id"),
;
CREATE TABLE "ipypbxweb_extension" (
"id" integer NOT NULL PRIMARY KEY,
+ "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
"destination_match" varchar(100) NOT NULL,
"xml_dialplan" text NOT NULL,
"domain_id" integer NOT NULL REFERENCES "ipypbxweb_domain" ("id"),
)
;
CREATE INDEX "ipypbxweb_sipprofile_connection_id" ON "ipypbxweb_sipprofile" ("connection_id");
+CREATE INDEX "ipypbxweb_domain_connection_id" ON "ipypbxweb_domain" ("connection_id");
CREATE INDEX "ipypbxweb_domain_sip_profile_id" ON "ipypbxweb_domain" ("sip_profile_id");
+CREATE INDEX "ipypbxweb_gateway_connection_id" ON "ipypbxweb_gateway" ("connection_id");
CREATE INDEX "ipypbxweb_gateway_sip_profile_id" ON "ipypbxweb_gateway" ("sip_profile_id");
+CREATE INDEX "ipypbxweb_endpoint_connection_id" ON "ipypbxweb_endpoint" ("connection_id");
CREATE INDEX "ipypbxweb_endpoint_domain_id" ON "ipypbxweb_endpoint" ("domain_id");
+CREATE INDEX "ipypbxweb_extension_connection_id" ON "ipypbxweb_extension" ("connection_id");
CREATE INDEX "ipypbxweb_extension_domain_id" ON "ipypbxweb_extension" ("domain_id");
CREATE INDEX "ipypbxweb_extension_endpoint_id" ON "ipypbxweb_extension" ("endpoint_id");
\ No newline at end of file