mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 09:03:49 +00:00
Change the table ownership
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
--
|
||||
-- Name: agents; Type: TABLE; Schema: public; Owner: fusionpbx; Tablespace:
|
||||
-- Name: agents; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
--
|
||||
CREATE TABLE agents (
|
||||
uuid uuid,
|
||||
@@ -25,7 +25,7 @@ CREATE TABLE agents (
|
||||
external_calls_count INTEGER NOT NULL DEFAULT 0,
|
||||
agent_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE agents OWNER TO fusionpbx;
|
||||
ALTER TABLE agents OWNER TO freeswitch;
|
||||
|
||||
|
||||
--
|
||||
@@ -38,7 +38,7 @@ CREATE TABLE aliases (
|
||||
hostname character varying(256),
|
||||
alias_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE aliases OWNER TO fusionpbx;
|
||||
ALTER TABLE aliases OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: calls; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -51,7 +51,7 @@ CREATE TABLE calls (
|
||||
callee_uuid character varying(256),
|
||||
hostname character varying(256)
|
||||
);
|
||||
ALTER TABLE calls OWNER TO fusionpbx;
|
||||
ALTER TABLE calls OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: channels; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -97,7 +97,7 @@ CREATE TABLE channels (
|
||||
initial_dialplan character varying(128),
|
||||
initial_context character varying(128)
|
||||
);
|
||||
ALTER TABLE channels OWNER TO fusionpbx;
|
||||
ALTER TABLE channels OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: complete; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -117,7 +117,7 @@ sticky integer,
|
||||
hostname character varying(256),
|
||||
complete_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE complete OWNER TO fusionpbx;
|
||||
ALTER TABLE complete OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: db_data; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -129,7 +129,7 @@ CREATE TABLE db_data (
|
||||
data character varying(255),
|
||||
db_data_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE db_data OWNER TO fusionpbx;
|
||||
ALTER TABLE db_data OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: db_data; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -163,7 +163,7 @@ CREATE TABLE fifo_outbound (
|
||||
stop_time integer not null default 0,
|
||||
fifo_outbound_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE fifo_outbound OWNER TO fusionpbx;
|
||||
ALTER TABLE fifo_outbound OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: db_data; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -178,7 +178,7 @@ CREATE TABLE fifo_bridge (
|
||||
bridge_start integer,
|
||||
fifo_bridge_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE fifo_bridge OWNER TO fusionpbx;
|
||||
ALTER TABLE fifo_bridge OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: group_data; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -191,7 +191,7 @@ CREATE TABLE fifo_callers (
|
||||
timestamp integer,
|
||||
fifo_caller_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE fifo_callers OWNER TO fusionpbx;
|
||||
ALTER TABLE fifo_callers OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: group_data; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -202,7 +202,7 @@ CREATE TABLE group_data (
|
||||
url character varying(255),
|
||||
group_data_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE group_data OWNER TO fusionpbx;
|
||||
ALTER TABLE group_data OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: interfaces; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -217,7 +217,7 @@ CREATE TABLE interfaces (
|
||||
hostname character varying(256),
|
||||
interace_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE interfaces OWNER TO fusionpbx;
|
||||
ALTER TABLE interfaces OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: limit_data; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -228,10 +228,10 @@ CREATE TABLE limit_data (
|
||||
id character varying(255),
|
||||
limit_data_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE limit_data OWNER TO fusionpbx;
|
||||
ALTER TABLE limit_data OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: members; Type: TABLE; Schema: public; Owner: fusionpbx; Tablespace:
|
||||
-- Name: members; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
--
|
||||
CREATE TABLE members (
|
||||
queue character varying(255),
|
||||
@@ -252,7 +252,7 @@ CREATE TABLE members (
|
||||
state character varying(255),
|
||||
member_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE members OWNER TO fusionpbx;
|
||||
ALTER TABLE members OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: nat; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -264,7 +264,7 @@ CREATE TABLE nat (
|
||||
hostname character varying(256),
|
||||
nat_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE nat OWNER TO fusionpbx;
|
||||
ALTER TABLE nat OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: recovery; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -277,7 +277,7 @@ CREATE TABLE recovery (
|
||||
metadata text,
|
||||
uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE recovery OWNER TO fusionpbx;
|
||||
ALTER TABLE recovery OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: registrations; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -295,7 +295,7 @@ CREATE TABLE registrations (
|
||||
metadata character varying(256),
|
||||
registration_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE registrations OWNER TO fusionpbx;
|
||||
ALTER TABLE registrations OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: sip_registrations; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -330,7 +330,7 @@ CREATE TABLE sip_registrations (
|
||||
sub_host character varying(255),
|
||||
sip_registration_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE sip_registrations OWNER TO fusionpbx;
|
||||
ALTER TABLE sip_registrations OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: sip_authentication; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -341,9 +341,9 @@ CREATE TABLE sip_authentication (
|
||||
profile_name character varying(255),
|
||||
hostname character varying(255),
|
||||
last_nc integer,
|
||||
sip_authentication_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
sip_authentication_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE sip_authentication OWNER TO fusionpbx;
|
||||
ALTER TABLE sip_authentication OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: sip_dialogs; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -375,7 +375,7 @@ CREATE TABLE sip_dialogs (
|
||||
rcd integer DEFAULT 0 NOT NULL,
|
||||
sip_dialog_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE sip_dialogs OWNER TO fusionpbx;
|
||||
ALTER TABLE sip_dialogs OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: sip_presence; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -394,7 +394,7 @@ CREATE TABLE sip_presence (
|
||||
open_closed character varying(255),
|
||||
sip_presence_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE sip_presence OWNER TO fusionpbx;
|
||||
ALTER TABLE sip_presence OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: sip_shared_appearance_dialogs; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -408,7 +408,7 @@ CREATE TABLE sip_shared_appearance_dialogs (
|
||||
expires bigint,
|
||||
sip_shared_appearance_dialog_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE sip_shared_appearance_dialogs OWNER TO fusionpbx;
|
||||
ALTER TABLE sip_shared_appearance_dialogs OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: sip_shared_appearance_subscriptions; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -423,7 +423,7 @@ CREATE TABLE sip_shared_appearance_subscriptions (
|
||||
network_ip character varying(255),
|
||||
sip_shared_appearance_subscription_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE sip_shared_appearance_subscriptions OWNER TO fusionpbx;
|
||||
ALTER TABLE sip_shared_appearance_subscriptions OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: sip_subscriptions; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -452,7 +452,7 @@ CREATE TABLE sip_subscriptions (
|
||||
full_to character varying(1024),
|
||||
sip_subscription_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE sip_subscriptions OWNER TO fusionpbx;
|
||||
ALTER TABLE sip_subscriptions OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: tasks; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
@@ -466,10 +466,10 @@ CREATE TABLE tasks (
|
||||
hostname character varying(256),
|
||||
task_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE tasks OWNER TO fusionpbx;
|
||||
ALTER TABLE tasks OWNER TO freeswitch;
|
||||
|
||||
--
|
||||
-- Name: tiers; Type: TABLE; Schema: public; Owner: fusionpbx; Tablespace:
|
||||
-- Name: tiers; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
--
|
||||
CREATE TABLE tiers (
|
||||
queue character varying(255),
|
||||
@@ -479,22 +479,22 @@ CREATE TABLE tiers (
|
||||
"position" integer DEFAULT 1 NOT NULL,
|
||||
tier_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE tiers OWNER TO fusionpbx;
|
||||
ALTER TABLE tiers OWNER TO freeswitch;
|
||||
|
||||
|
||||
--
|
||||
-- Name: json_store; Type: TABLE; Schema: public; Owner: fusionpbx; Tablespace:
|
||||
-- Name: json_store; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
|
||||
--
|
||||
CREATE TABLE json_store (
|
||||
name varchar(255) not null,
|
||||
data text,
|
||||
json_store_uuid uuid PRIMARY KEY default gen_random_uuid()
|
||||
);
|
||||
ALTER TABLE json_store OWNER TO fusionpbx;
|
||||
ALTER TABLE json_store OWNER TO freeswitch;
|
||||
|
||||
--Create Views
|
||||
|
||||
-- Name: basic_calls; Type: VIEW; Schema: public; Owner: fusionpbx
|
||||
-- Name: basic_calls; Type: VIEW; Schema: public; Owner: freeswitch
|
||||
|
||||
CREATE VIEW basic_calls AS
|
||||
SELECT a.uuid,
|
||||
@@ -543,9 +543,9 @@ SELECT a.uuid,
|
||||
WHERE (((a.uuid)::text = (c.caller_uuid)::text) OR (NOT ((a.uuid)::text IN ( SELECT calls.callee_uuid
|
||||
FROM calls))));
|
||||
|
||||
ALTER TABLE basic_calls OWNER TO fusionpbx;
|
||||
ALTER TABLE basic_calls OWNER TO freeswitch;
|
||||
|
||||
-- Name: detailed_calls; Type: VIEW; Schema: public; Owner: fusionpbx
|
||||
-- Name: detailed_calls; Type: VIEW; Schema: public; Owner: freeswitch
|
||||
|
||||
CREATE VIEW detailed_calls AS
|
||||
SELECT a.uuid AS uuid,
|
||||
@@ -619,7 +619,7 @@ SELECT a.uuid AS uuid,
|
||||
FROM calls))));
|
||||
|
||||
|
||||
ALTER TABLE detailed_calls OWNER TO fusionpbx;
|
||||
ALTER TABLE detailed_calls OWNER TO freeswitch;
|
||||
|
||||
|
||||
--Indexes and Constraints
|
||||
@@ -731,3 +731,4 @@ CREATE INDEX ssd_profile_name ON sip_shared_appearance_dialogs USING btree (prof
|
||||
CREATE INDEX tasks1 ON tasks USING btree (hostname, task_id);
|
||||
CREATE INDEX uuindex ON channels USING btree (uuid, hostname);
|
||||
CREATE INDEX uuindex2 ON channels USING btree (call_uuid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user