From 77db515b3eb19232e879769b94b431db435c7a46 Mon Sep 17 00:00:00 2001 From: konovalovsergey Date: Thu, 10 Nov 2016 12:08:29 +0300 Subject: [PATCH] sql drop tables before create --- schema/createdb.sql | 1 + schema/postgresql/createdb.sql | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/schema/createdb.sql b/schema/createdb.sql index e4d0f5f3..4945f74d 100644 --- a/schema/createdb.sql +++ b/schema/createdb.sql @@ -26,6 +26,7 @@ USE onlyoffice; -- DROP TABLE IF EXISTS `doc_callbacks`; DROP TABLE IF EXISTS `doc_changes`; +DROP TABLE IF EXISTS `task_result`; -- -- Definition of table `doc_callbacks` diff --git a/schema/postgresql/createdb.sql b/schema/postgresql/createdb.sql index 096d91d7..b91b38fd 100644 --- a/schema/postgresql/createdb.sql +++ b/schema/postgresql/createdb.sql @@ -9,6 +9,7 @@ -- DROP TABLE IF EXISTS "public"."doc_callbacks"; DROP TABLE IF EXISTS "public"."doc_changes"; +DROP TABLE IF EXISTS "public"."task_result"; -- ---------------------------- -- Table structure for doc_callbacks @@ -52,6 +53,9 @@ PRIMARY KEY ("id") WITH (OIDS=FALSE); --https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE +DROP FUNCTION IF EXISTS merge_db(_id varchar(255), _status int2, _status_info int8, _last_open_date timestamp without time zone, _title varchar(255), _user_index int8, _change_id int8, OUT isupdate char(5), OUT userindex int8) CASCADE; +DROP FUNCTION IF EXISTS merge_db(_id varchar(255), _status int2, _status_info int4, _last_open_date timestamp without time zone, _title varchar(255), _user_index int4, _change_id int4, OUT isupdate char(5), OUT userindex int4) CASCADE; + CREATE OR REPLACE FUNCTION merge_db(_id varchar(255), _status int2, _status_info int4, _last_open_date timestamp without time zone, _title varchar(255), _user_index int4, _change_id int4, OUT isupdate char(5), OUT userindex int4) AS $$ DECLARE