Commit 228fc2a0 by ansible

no message

1 parent 7f191cda
......@@ -218,9 +218,9 @@ WITH (
CREATE TABLE public.wd_authen_input_publish (
id int4 NOT NULL,
"index" int4 NULL,
field_name varchar(50) NULL,
field_name varchar(100) NULL,
default_value varchar(100) NULL,
value_form varchar(100) NULL,
value_from varchar(100) NULL,
xpath varchar(500) NULL,
user_authen_id int4 NOT NULL,
CONSTRAINT wd_authen_input_publish_pkey PRIMARY KEY (id),
......@@ -234,9 +234,9 @@ WITH (
CREATE TABLE public.wd_authen_input_temp (
id int4 NOT NULL DEFAULT nextval('wd_authen_input_temp_id_seq'::regclass),
"index" int4 NULL,
field_name varchar(50) NULL,
field_name varchar(100) NULL,
default_value varchar(100) NULL,
value_form varchar(100) NULL,
value_from varchar(100) NULL,
xpath varchar(500) NULL,
user_authen_id int4 NOT NULL,
CONSTRAINT wd_authen_input_temp_pkey PRIMARY KEY (id),
......@@ -251,15 +251,18 @@ WITH (
CREATE TABLE public.wd_authen_output_publish (
id int4 NOT NULL,
"index" int4 NULL,
field_name varchar(50) NULL,
"type" varchar(100) NULL,
word_success varchar(250) NULL,
xpath varchar(500) NULL,
user_authen_id int4 NOT NULL,
CONSTRAINT wd_authen_output_publish_pkey PRIMARY KEY (id),
CONSTRAINT wd_authen_output_publish_wd_user_authen_publish_fk FOREIGN KEY (user_authen_id) REFERENCES public.wd_user_authen_publish(id)
id integer NOT NULL DEFAULT nextval('wd_authen_output_publish_id_seq'::regclass),
field_name character varying(100),
field_type character varying(50),
success_type character varying(20),
success_value character varying(100),
user_authen_id integer NOT NULL,
xpath character varying(500),
json_sample character varying(3000),
CONSTRAINT id_pk PRIMARY KEY (id),
CONSTRAINT wd_authen_output_publish_wd_user_authen_publish_fk FOREIGN KEY (user_authen_id)
REFERENCES public.wd_user_authen_publish (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
......@@ -269,15 +272,18 @@ WITH (
CREATE TABLE public.wd_authen_output_temp (
id int4 NOT NULL DEFAULT nextval('wd_authen_output_temp_id_seq'::regclass),
"index" int4 NULL,
field_name varchar(50) NULL,
"type" varchar(100) NULL,
word_success varchar(250) NULL,
xpath varchar(500) NULL,
user_authen_id int4 NOT NULL,
CONSTRAINT wd_authen_output_temp_pkey PRIMARY KEY (id),
CONSTRAINT wd_authen_output_temp_wd_user_authen_temp_fk FOREIGN KEY (user_authen_id) REFERENCES public.wd_user_authen_temp(id)
id integer NOT NULL DEFAULT nextval('wd_authen_output_temp_id_seq'::regclass),
field_name character varying(100),
field_type character varying(50),
success_type character varying(20),
success_value character varying(100),
user_authen_id integer NOT NULL,
xpath character varying(500),
json_sample character varying(3000),
CONSTRAINT wd_authen_output_temp_pkey PRIMARY KEY (id),
CONSTRAINT wd_authen_output_temp_wd_user_authen_temp_fk FOREIGN KEY (user_authen_id)
REFERENCES public.wd_user_authen_temp (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
......@@ -588,4 +594,144 @@ WITH (
CREATE UNIQUE INDEX wd_personal_contract_unique_index ON public.wd_personal_contract ("actionUserId","addedUserId") ;
--------------- CREATE TABLE DMA MESSAGE
-- Table: public.dma_message
-- DROP TABLE public.dma_message;
CREATE TABLE public.dma_message
(
id integer NOT NULL DEFAULT nextval('dma_message_id_seq'::regclass),
key character varying(100) COLLATE pg_catalog."default",
"fromUserId" integer,
"toUserId" integer,
"contactIds" character varying(2000) COLLATE pg_catalog."default",
message character varying(4096) COLLATE pg_catalog."default",
sent boolean DEFAULT false,
delivered boolean DEFAULT false,
read boolean DEFAULT false,
"createdAtTime" bigint,
type integer,
source integer,
status integer NOT NULL DEFAULT 0,
paired_message_id integer,
"contentType" integer,
group_id integer,
group_name character varying(200) COLLATE pg_catalog."default",
from_user_name character varying(80) COLLATE pg_catalog."default",
metadata character varying(100) COLLATE pg_catalog."default",
delivered_time timestamp without time zone,
"createdDate" timestamp without time zone DEFAULT now(),
"updatedDate" timestamp without time zone DEFAULT now(),
"deviceKey" character varying(200) COLLATE pg_catalog."default",
shared boolean DEFAULT false,
"storeOnDevice" boolean DEFAULT false,
"sentToServer" boolean DEFAULT false,
"sendToDevice" boolean DEFAULT false,
"sentMessageTimeAtServer" integer,
"documentId" character varying COLLATE pg_catalog."default",
delete boolean DEFAULT false,
"paredUserId" character varying(100) COLLATE pg_catalog."default",
CONSTRAINT dma_message_pkey PRIMARY KEY (id),
CONSTRAINT dma_message_fromuserid_wd_user_fk FOREIGN KEY ("fromUserId")
REFERENCES public.wd_user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT dma_message_togroupid_wd_group_fk FOREIGN KEY (group_id)
REFERENCES public.wd_group (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT dma_message_touserid_wd_user_fk FOREIGN KEY ("toUserId")
REFERENCES public.wd_user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.dma_message
OWNER to wdchat;
-- Index: dma_message_idx_createdattime
-- DROP INDEX public.dma_message_idx_createdattime;
CREATE INDEX dma_message_idx_createdattime
ON public.dma_message USING btree
("createdAtTime")
TABLESPACE pg_default;
-- Table: public.dma_message_user_rel
-- DROP TABLE public.dma_message_user_rel;
CREATE TABLE public.dma_message_user_rel
(
id integer NOT NULL DEFAULT nextval('dma_message_user_rel_id_seq'::regclass),
"messageId" integer NOT NULL,
"userId" integer NOT NULL,
read boolean DEFAULT false,
delete boolean DEFAULT false,
"createdDate" timestamp without time zone NOT NULL DEFAULT now(),
"updatedDate" timestamp without time zone NOT NULL DEFAULT now(),
delivered boolean DEFAULT false,
"deliveredAtTime" timestamp without time zone,
"readAtTime" timestamp without time zone,
blocked boolean DEFAULT false,
"blockedAtTime" timestamp without time zone,
"deleteAtTime" timestamp without time zone,
CONSTRAINT dma_message_user_rel_pk PRIMARY KEY (id),
CONSTRAINT dma_message_user_rel_dma_message_fk FOREIGN KEY ("messageId")
REFERENCES public.dma_message (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT dma_message_user_rel_wd_user_fk FOREIGN KEY ("userId")
REFERENCES public.wd_user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.dma_message_user_rel
OWNER to wdchat;
-- Index: dma_message_user_rel_constain_unique
-- DROP INDEX public.dma_message_user_rel_constain_unique;
CREATE UNIQUE INDEX dma_message_user_rel_constain_unique
ON public.dma_message_user_rel USING btree
("messageId" DESC, "userId" DESC)
TABLESPACE pg_default;
-------------------------------------------------------
CREATE SEQUENCE public.dma_message_id_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 9223372036854775807
CACHE 1;
ALTER SEQUENCE public.dma_message_id_seq
OWNER TO wdchat;
CREATE SEQUENCE public.dma_message_user_rel_id_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 9223372036854775807
CACHE 1;
ALTER SEQUENCE public.dma_message_user_rel_id_seq
OWNER TO wdchat;
-- initial wd_user
INSERT INTO public.wd_user
("userId", password, "displayName", email, "contactNumber", "roleName", "createdDate", "updatedDate", id, "imageLinkUrl", "userKey", "emailVerified", "enableEncryption", timezone, "prefContactAPI", deactivate, "pricingPackage", "lastSeenAtTime", status, "statusMessage", "imageLink", "lastLoggedInAtTime", "lastMessageAtTime", connected)
VALUES('admin', 'password', 'admin', 'admin@hotmail.com', NULL, NULL, '2017-06-16 17:27:50.271', '2017-07-27 14:01:59.212', 1, NULL, '816edb8c-1011-4160-bfa7-133794d96ea7', NULL, NULL, NULL, NULL, false, NULL, 1501138919208, NULL, NULL, NULL, NULL, NULL, false);
INSERT INTO public.wd_user_app_rel
(id, "userId", "applicationId", "deviceKey", "createdDate", "updatedDate", "registrationId", "userKey", "pushNotificationFormat", "deviceType", "lastSyncTime")
VALUES(1, 1, NULL, 'YWRtaW4jOiM4IzojMTQ5ODEwNjQ3MDE3NSM6Izk2ZGE3Yzc1LTRlNjgtNDZmNS04ZmI2LTQ1MzZlNDk5NzUxZA==', '2017-06-22 11:41:10.177', '2017-06-22 11:41:10.177', NULL, '816edb8c-1011-4160-bfa7-133794d96ea7', NULL, 8, 1498106470175);
-- initial user for transaction log (WD Bot)
INSERT INTO public.wd_user
("userId", password, "displayName", email, "contactNumber", "roleName", "createdDate", "updatedDate", id, "imageLinkUrl", "userKey", "emailVerified", "enableEncryption", timezone, "prefContactAPI", deactivate, "pricingPackage", "lastSeenAtTime", status, "statusMessage", "imageLink", "lastLoggedInAtTime", "lastMessageAtTime", connected)
VALUES('wdbot', 'password', 'wdbot', 'admin@hotmail.com', NULL, NULL, '2017-06-16 17:27:50.271', '2017-07-27 14:01:59.212', 2, NULL, '2af95700-2615-45e0-839a-468b6f7fbd7a', NULL, NULL, NULL, NULL, false, NULL, 1501138919208, NULL, NULL, NULL, NULL, NULL, false);
INSERT INTO public.wd_user_app_rel
(id, "userId", "applicationId", "deviceKey", "createdDate", "updatedDate", "registrationId", "userKey", "pushNotificationFormat", "deviceType", "lastSyncTime")
VALUES(2, 2, NULL, 'd2Rib3QjOiMwIzojMTUwNTkwOTQ2MzYzMyM6IzQwMTFhZTVkLTk2ZTItNGZhMC1hOTc4LTYxNWE4ZmVhMTBkMw==', '2017-06-22 11:41:10.177', '2017-06-22 11:41:10.177', NULL, '2af95700-2615-45e0-839a-468b6f7fbd7a', NULL, 8, 1498106470175);
-- initial user for transaction log (DMA Bot)
INSERT INTO public.wd_user
("userId", password, "displayName", email, "contactNumber", "roleName", "createdDate", "updatedDate", id, "imageLinkUrl", "userKey", "emailVerified", "enableEncryption", timezone, "prefContactAPI", deactivate, "pricingPackage", "lastSeenAtTime", status, "statusMessage", "imageLink", "lastLoggedInAtTime", "lastMessageAtTime", connected)
VALUES('dmabot', 'password', 'dmabot', 'admin@hotmail.com', NULL, NULL, '2017-06-16 17:27:50.271', '2017-07-27 14:01:59.212', 3, NULL, 'f2c2cf53-ab6e-4f4f-a021-a2eacf28c6f4', NULL, NULL, NULL, NULL, false, NULL, 1501138919208, NULL, NULL, NULL, NULL, NULL, false);
INSERT INTO public.wd_user_app_rel
(id, "userId", "applicationId", "deviceKey", "createdDate", "updatedDate", "registrationId", "userKey", "pushNotificationFormat", "deviceType", "lastSyncTime")
VALUES(3, 3, NULL, 'ZG1hYm90IzojMCM6IzE1MDU5MDk0ODI2MjYjOiNmNDQ5ODc0YS1lYzMyLTQ3OTgtOGM5ZS1kODQzNmJhZmY0MmE=', '2017-06-22 11:41:10.177', '2017-06-22 11:41:10.177', NULL, 'f2c2cf53-ab6e-4f4f-a021-a2eacf28c6f4', NULL, 8, 1498106470175);
-- initial wd_admin_user
INSERT INTO public.wd_admin_user (username,password,actived,id) VALUES (
......@@ -196,6 +169,8 @@ INSERT INTO public.wd_sys_config
VALUES(65, 'system', 'mqtt_password', 'BBgXC8zQ7WGmcpVa', 'Mqtt authen');
INSERT INTO public.wd_sys_config
(id, sys_group, sys_key, sys_value, sys_description)
VALUES(67, 'Housekeeping', 'MaxMsgPerPage', '500', 'Maximum archrive chat log per file');
......@@ -219,9 +194,13 @@ VALUES(70, 'appversion', 'iOS', '1.0', 'version ios');
INSERT INTO public.wd_sys_config
(id, sys_group, sys_key, sys_value, sys_description)
VALUES(71, 'appversion', 'Android', '1.0', 'version android');
-- initial version for check update application
INSERT INTO public.wd_sys_config
(id, sys_group, sys_key, sys_value, sys_description)
VALUES(72, 'appversion', 'update_url', 'https://ichat.beebuddy.net:444/index.html', 'update url');
------------------------------------------------------------
INSERT INTO public.wd_sys_config
(id, sys_group, sys_key, sys_value, sys_description)
VALUES(75, 'system', 'clear_msg_when_left_group_flag', 'off', 'When remove member from group then delete conversation . on/off');
......@@ -233,14 +212,35 @@ VALUES(76, 'system', 'group_using_lastSync_by_join', 'on', 'sync message add con
-- initial wd_user
INSERT INTO public.wd_user
("userId", password, "displayName", email, "contactNumber", "roleName", "createdDate", "updatedDate", id, "imageLinkUrl", "userKey", "emailVerified", "enableEncryption", timezone, "prefContactAPI", deactivate, "pricingPackage", "lastSeenAtTime", status, "statusMessage", "imageLink", "lastLoggedInAtTime", "lastMessageAtTime", connected)
VALUES('admin', 'password', 'admin', 'admin@hotmaail.com', NULL, NULL, '2017-06-16 17:27:50.271', '2017-07-27 14:01:59.212', 1, NULL, '816edb8c-1011-4160-bfa7-133794d96ea7', NULL, NULL, NULL, NULL, false, NULL, 1501138919208, NULL, NULL, NULL, NULL, NULL, false);
VALUES('admin', 'password', 'admin', 'admin@hotmail.com', NULL, NULL, '2017-06-16 17:27:50.271', '2017-07-27 14:01:59.212', 1, NULL, '816edb8c-1011-4160-bfa7-133794d96ea7', NULL, NULL, NULL, NULL, false, NULL, 1501138919208, NULL, NULL, NULL, NULL, NULL, false);
INSERT INTO public.wd_user_app_rel
(id, "userId", "applicationId", "deviceKey", "createdDate", "updatedDate", "registrationId", "userKey", "pushNotificationFormat", "deviceType", "lastSyncTime")
VALUES(1, 1, NULL, 'YWRtaW4jOiM4IzojMTQ5ODEwNjQ3MDE3NSM6Izk2ZGE3Yzc1LTRlNjgtNDZmNS04ZmI2LTQ1MzZlNDk5NzUxZA==', '2017-06-22 11:41:10.177', '2017-06-22 11:41:10.177', NULL, '816edb8c-1011-4160-bfa7-133794d96ea7', NULL, 8, 1498106470175);
-- initial user for transaction log (WD Bot)
INSERT INTO public.wd_user
("userId", password, "displayName", email, "contactNumber", "roleName", "createdDate", "updatedDate", id, "imageLinkUrl", "userKey", "emailVerified", "enableEncryption", timezone, "prefContactAPI", deactivate, "pricingPackage", "lastSeenAtTime", status, "statusMessage", "imageLink", "lastLoggedInAtTime", "lastMessageAtTime", connected)
VALUES('wdbot', 'password', 'wdbot', 'admin@hotmail.com', NULL, NULL, '2017-06-16 17:27:50.271', '2017-07-27 14:01:59.212', 2, NULL, '2af95700-2615-45e0-839a-468b6f7fbd7a', NULL, NULL, NULL, NULL, false, NULL, 1501138919208, NULL, NULL, NULL, NULL, NULL, false);
INSERT INTO public.wd_user_app_rel
(id, "userId", "applicationId", "deviceKey", "createdDate", "updatedDate", "registrationId", "userKey", "pushNotificationFormat", "deviceType", "lastSyncTime")
VALUES(2, 2, NULL, 'd2Rib3QjOiMwIzojMTUwNTkwOTQ2MzYzMyM6IzQwMTFhZTVkLTk2ZTItNGZhMC1hOTc4LTYxNWE4ZmVhMTBkMw==', '2017-06-22 11:41:10.177', '2017-06-22 11:41:10.177', NULL, '2af95700-2615-45e0-839a-468b6f7fbd7a', NULL, 8, 1498106470175);
-- initial user for transaction log (DMA Bot)
INSERT INTO public.wd_user
("userId", password, "displayName", email, "contactNumber", "roleName", "createdDate", "updatedDate", id, "imageLinkUrl", "userKey", "emailVerified", "enableEncryption", timezone, "prefContactAPI", deactivate, "pricingPackage", "lastSeenAtTime", status, "statusMessage", "imageLink", "lastLoggedInAtTime", "lastMessageAtTime", connected)
VALUES('dmabot', 'password', 'dmabot', 'admin@hotmail.com', NULL, NULL, '2017-06-16 17:27:50.271', '2017-07-27 14:01:59.212', 3, NULL, 'f2c2cf53-ab6e-4f4f-a021-a2eacf28c6f4', NULL, NULL, NULL, NULL, false, NULL, 1501138919208, NULL, NULL, NULL, NULL, NULL, false);
INSERT INTO public.wd_user_app_rel
(id, "userId", "applicationId", "deviceKey", "createdDate", "updatedDate", "registrationId", "userKey", "pushNotificationFormat", "deviceType", "lastSyncTime")
VALUES(3, 3, NULL, 'ZG1hYm90IzojMCM6IzE1MDU5MDk0ODI2MjYjOiNmNDQ5ODc0YS1lYzMyLTQ3OTgtOGM5ZS1kODQzNmJhZmY0MmE=', '2017-06-22 11:41:10.177', '2017-06-22 11:41:10.177', NULL, 'f2c2cf53-ab6e-4f4f-a021-a2eacf28c6f4', NULL, 8, 1498106470175);
-- initial wd_version
INSERT INTO public.wd_version (id,version_id) VALUES (
1,'1.0.0');
......
......@@ -12,6 +12,10 @@ START 198;
CREATE TABLE public.wd_user (
username varchar(40) NULL,
password varchar(254) NULL,
retry_count INTEGER,
status character varying(20),
created_date TIMESTAMP WITHOUT TIME ZONE,
updated_date TIMESTAMP WITHOUT TIME ZONE,
id int4 NOT NULL DEFAULT nextval('wd_user_id_seq'::regclass),
CONSTRAINT wd_user_pk PRIMARY KEY (id),
CONSTRAINT wd_user_uni01 UNIQUE (username)
......
ALTER TABLE wd_user
ADD COLUMN retry_count INTEGER;
ALTER TABLE wd_user
ADD COLUMN status character varying(20);
ALTER TABLE wd_user
ADD COLUMN created_date TIMESTAMP WITHOUT TIME ZONE;
ALTER TABLE wd_user
ADD COLUMN updated_date TIMESTAMP WITHOUT TIME ZONE;
\ No newline at end of file
Drop Table IF EXISTS public.wd_user;
CREATE TABLE public.wd_user (
username varchar(40) NULL,
password varchar(254) NULL,
retry_count INTEGER,
status character varying(20),
created_date TIMESTAMP WITHOUT TIME ZONE,
updated_date TIMESTAMP WITHOUT TIME ZONE,
id int4 NOT NULL DEFAULT nextval('wd_user_id_seq'::regclass),
CONSTRAINT wd_user_pk PRIMARY KEY (id),
CONSTRAINT wd_user_uni01 UNIQUE (username)
)
WITH (
OIDS=FALSE
) ;
\ No newline at end of file
Drop Table IF EXISTS public.wd_authen_input_publish;
CREATE TABLE public.wd_authen_input_publish (
id int4 NOT NULL,
"index" int4 NULL,
field_name varchar(100) NULL,
default_value varchar(100) NULL,
value_from varchar(100) NULL,
xpath varchar(500) NULL,
user_authen_id int4 NOT NULL,
CONSTRAINT wd_authen_input_publish_pkey PRIMARY KEY (id),
CONSTRAINT wd_authen_input_publish_wd_user_authen_publish_fk FOREIGN KEY (user_authen_id) REFERENCES public.wd_user_authen_publish(id)
)
WITH (
OIDS=FALSE
) ;
Drop Table IF EXISTS public.wd_authen_input_temp;
CREATE TABLE public.wd_authen_input_temp (
id int4 NOT NULL DEFAULT nextval('wd_authen_input_temp_id_seq'::regclass),
"index" int4 NULL,
field_name varchar(100) NULL,
default_value varchar(100) NULL,
value_from varchar(100) NULL,
xpath varchar(500) NULL,
user_authen_id int4 NOT NULL,
CONSTRAINT wd_authen_input_temp_pkey PRIMARY KEY (id),
CONSTRAINT wd_authen_input_temp_wd_user_authen_temp_fk FOREIGN KEY (user_authen_id) REFERENCES public.wd_user_authen_temp(id)
)
WITH (
OIDS=FALSE
) ;
Drop Table IF EXISTS public.wd_authen_output_publish;
CREATE TABLE public.wd_authen_output_publish (
id integer NOT NULL,
field_name character varying(100),
field_type character varying(50),
success_type character varying(20),
success_value character varying(100),
user_authen_id integer NOT NULL,
xpath character varying(500),
json_sample character varying(3000),
CONSTRAINT id_pk PRIMARY KEY (id),
CONSTRAINT wd_authen_output_publish_wd_user_authen_publish_fk FOREIGN KEY (user_authen_id)
REFERENCES public.wd_user_authen_publish (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
) ;
Drop Table IF EXISTS public.wd_authen_output_temp;
CREATE TABLE public.wd_authen_output_temp (
id integer NOT NULL DEFAULT nextval('wd_authen_output_temp_id_seq'::regclass),
field_name character varying(100),
field_type character varying(50),
success_type character varying(20),
success_value character varying(100),
user_authen_id integer NOT NULL,
xpath character varying(500),
json_sample character varying(3000),
CONSTRAINT wd_authen_output_temp_pkey PRIMARY KEY (id),
CONSTRAINT wd_authen_output_temp_wd_user_authen_temp_fk FOREIGN KEY (user_authen_id)
REFERENCES public.wd_user_authen_temp (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
) ;
\ No newline at end of file
CREATE SEQUENCE public.dma_message_id_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 9223372036854775807
CACHE 1;
ALTER SEQUENCE public.dma_message_id_seq
OWNER TO wdchat;
\ No newline at end of file
CREATE SEQUENCE public.dma_message_user_rel_id_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 9223372036854775807
CACHE 1;
ALTER SEQUENCE public.dma_message_user_rel_id_seq
OWNER TO wdchat;
\ No newline at end of file
-- Table: public.dma_message
-- DROP TABLE public.dma_message;
CREATE TABLE public.dma_message
(
id integer NOT NULL DEFAULT nextval('dma_message_id_seq'::regclass),
key character varying(100) COLLATE pg_catalog."default",
"fromUserId" integer,
"toUserId" integer,
"contactIds" character varying(2000) COLLATE pg_catalog."default",
message character varying(4096) COLLATE pg_catalog."default",
sent boolean DEFAULT false,
delivered boolean DEFAULT false,
read boolean DEFAULT false,
"createdAtTime" bigint,
type integer,
source integer,
status integer NOT NULL DEFAULT 0,
paired_message_id integer,
"contentType" integer,
group_id integer,
group_name character varying(200) COLLATE pg_catalog."default",
from_user_name character varying(80) COLLATE pg_catalog."default",
metadata character varying(100) COLLATE pg_catalog."default",
delivered_time timestamp without time zone,
"createdDate" timestamp without time zone DEFAULT now(),
"updatedDate" timestamp without time zone DEFAULT now(),
"deviceKey" character varying(200) COLLATE pg_catalog."default",
shared boolean DEFAULT false,
"storeOnDevice" boolean DEFAULT false,
"sentToServer" boolean DEFAULT false,
"sendToDevice" boolean DEFAULT false,
"sentMessageTimeAtServer" integer,
"documentId" character varying COLLATE pg_catalog."default",
delete boolean DEFAULT false,
"paredUserId" character varying(100) COLLATE pg_catalog."default",
CONSTRAINT dma_message_pkey PRIMARY KEY (id),
CONSTRAINT dma_message_fromuserid_wd_user_fk FOREIGN KEY ("fromUserId")
REFERENCES public.wd_user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT dma_message_togroupid_wd_group_fk FOREIGN KEY (group_id)
REFERENCES public.wd_group (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT dma_message_touserid_wd_user_fk FOREIGN KEY ("toUserId")
REFERENCES public.wd_user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.dma_message
OWNER to wdchat;
-- Index: dma_message_idx_createdattime
-- DROP INDEX public.dma_message_idx_createdattime;
CREATE INDEX dma_message_idx_createdattime
ON public.dma_message USING btree
("createdAtTime")
TABLESPACE pg_default;
\ No newline at end of file
-- Table: public.dma_message_user_rel
-- DROP TABLE public.dma_message_user_rel;
CREATE TABLE public.dma_message_user_rel
(
id integer NOT NULL DEFAULT nextval('dma_message_user_rel_id_seq'::regclass),
"messageId" integer NOT NULL,
"userId" integer NOT NULL,
read boolean DEFAULT false,
delete boolean DEFAULT false,
"createdDate" timestamp without time zone NOT NULL DEFAULT now(),
"updatedDate" timestamp without time zone NOT NULL DEFAULT now(),
delivered boolean DEFAULT false,
"deliveredAtTime" timestamp without time zone,
"readAtTime" timestamp without time zone,
blocked boolean DEFAULT false,
"blockedAtTime" timestamp without time zone,
"deleteAtTime" timestamp without time zone,
CONSTRAINT dma_message_user_rel_pk PRIMARY KEY (id),
CONSTRAINT dma_message_user_rel_dma_message_fk FOREIGN KEY ("messageId")
REFERENCES public.dma_message (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT dma_message_user_rel_wd_user_fk FOREIGN KEY ("userId")
REFERENCES public.wd_user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.dma_message_user_rel
OWNER to wdchat;
-- Index: dma_message_user_rel_constain_unique
-- DROP INDEX public.dma_message_user_rel_constain_unique;
CREATE UNIQUE INDEX dma_message_user_rel_constain_unique
ON public.dma_message_user_rel USING btree
("messageId" DESC, "userId" DESC)
TABLESPACE pg_default;
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!