Skip to content

Commit

Permalink
Update test data to match recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Apr 11, 2024
1 parent caa560a commit 155b18f
Showing 1 changed file with 38 additions and 33 deletions.
71 changes: 38 additions & 33 deletions testdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ CREATE TABLE orgs_org (
created_on timestamp with time zone NOT NULL
);

CREATE TABLE auth_user (
id serial primary key,
username character varying(128) NOT NULL
);

CREATE TABLE channels_channel (
id serial primary key,
uuid character varying(36) NOT NULL,
Expand Down Expand Up @@ -84,33 +89,6 @@ CREATE TABLE flows_flow (
name character varying(128) NOT NULL
);

CREATE TABLE msgs_msg (
id serial primary key,
uuid uuid NULL,
org_id integer NOT NULL REFERENCES orgs_org(id),
broadcast_id integer NULL,
text text NOT NULL,
high_priority boolean NULL,
created_on timestamp with time zone NOT NULL,
modified_on timestamp with time zone NOT NULL,
sent_on timestamp with time zone,
queued_on timestamp with time zone,
direction character varying(1) NOT NULL,
status character varying(1) NOT NULL,
visibility character varying(1) NOT NULL,
msg_type character varying(1),
msg_count integer NOT NULL,
error_count integer NOT NULL,
next_attempt timestamp with time zone NOT NULL,
external_id character varying(255),
attachments character varying(255)[],
channel_id integer REFERENCES channels_channel(id),
contact_id integer NOT NULL REFERENCES contacts_contact(id),
contact_urn_id integer NULL REFERENCES contacts_contacturn(id),
flow_id integer NULL REFERENCES flows_flow(id),
metadata text
);

CREATE TABLE msgs_broadcast (
id serial primary key,
org_id integer NOT NULL REFERENCES orgs_org(id),
Expand Down Expand Up @@ -138,6 +116,39 @@ CREATE TABLE msgs_broadcastmsgcount (
broadcast_id integer NOT NULL REFERENCES msgs_broadcast(id)
);

CREATE TABLE msgs_msg (
id bigserial PRIMARY KEY,
uuid uuid NOT NULL,
org_id integer NOT NULL REFERENCES orgs_org(id) ON DELETE CASCADE,
channel_id integer REFERENCES channels_channel(id) ON DELETE CASCADE,
contact_id integer NOT NULL REFERENCES contacts_contact(id) ON DELETE CASCADE,
contact_urn_id integer REFERENCES contacts_contacturn(id) ON DELETE CASCADE,
broadcast_id integer REFERENCES msgs_broadcast(id) ON DELETE CASCADE,
flow_id integer REFERENCES flows_flow(id) ON DELETE CASCADE,
--ticket_id integer REFERENCES tickets_ticket(id) ON DELETE CASCADE,
created_by_id integer REFERENCES auth_user(id) ON DELETE CASCADE,
text text NOT NULL,
attachments character varying(255)[] NULL,
quick_replies character varying(64)[] NULL,
optin_id integer REFERENCES msgs_optin(id) ON DELETE CASCADE,
locale character varying(6) NULL,
created_on timestamp with time zone NOT NULL,
modified_on timestamp with time zone NOT NULL,
sent_on timestamp with time zone,
msg_type character varying(1) NOT NULL,
direction character varying(1) NOT NULL,
status character varying(1) NOT NULL,
visibility character varying(1) NOT NULL,
msg_count integer NOT NULL,
high_priority boolean NULL,
error_count integer NOT NULL,
next_attempt timestamp with time zone NOT NULL,
failed_reason character varying(1),
external_id character varying(255),
metadata text,
log_uuids uuid[]
);

CREATE TABLE msgs_label (
id serial primary key,
uuid character varying(36) NULL,
Expand All @@ -150,11 +161,6 @@ CREATE TABLE msgs_msg_labels (
label_id integer NOT NULL REFERENCES msgs_label(id)
);

CREATE TABLE auth_user (
id serial primary key,
username character varying(128) NOT NULL
);

CREATE TABLE ivr_call (
id serial primary key,
org_id integer NOT NULL REFERENCES orgs_org(id),
Expand Down Expand Up @@ -198,7 +204,6 @@ CREATE TABLE flows_flowrun (
created_on timestamp with time zone NOT NULL,
modified_on timestamp with time zone NOT NULL,
exited_on timestamp with time zone NULL,
submitted_by_id integer NULL REFERENCES auth_user(id),
status varchar(1) NOT NULL,
delete_from_results boolean
);
Expand Down

0 comments on commit 155b18f

Please sign in to comment.