aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/IM_Store.migrations
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/IM_Store.migrations')
-rw-r--r--OpenSim/Data/PGSQL/Resources/IM_Store.migrations45
1 files changed, 45 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/IM_Store.migrations b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations
new file mode 100644
index 0000000..eb97824
--- /dev/null
+++ b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations
@@ -0,0 +1,45 @@
1:VERSION 1 # --------------------------
2
3BEGIN Transaction;
4
5Create Sequence im_offiline_id increment by 1 start with 1;
6
7CREATE TABLE im_offline (
8 "ID" integer PRIMARY KEY NOT NULL DEFAULT nextval('im_offiline_id') ,
9 "PrincipalID" char(36) NOT NULL default '',
10 "Message" text NOT NULL,
11 "TMStamp" timestamp NOT NULL default now()
12);
13
14COMMIT;
15
16:VERSION 2 # --------------------------
17
18BEGIN;
19
20/*
21INSERT INTO `im_offline` SELECT * from `diva_im_offline`;
22DROP TABLE `diva_im_offline`;
23DELETE FROM `migrations` WHERE name='diva_im_Store';
24*/
25
26COMMIT;
27
28:VERSION 3 # --------------------------
29
30BEGIN;
31
32-- dropping the table here as there most likely is only one record in the table at the time of migration
33
34DROP TABLE IF EXISTS "public"."im_offline";
35CREATE TABLE "public"."im_offline" (
36 "ID" serial,
37 "PrincipalID" uuid NOT NULL,
38 "Message" text NOT NULL COLLATE "default",
39 "TMStamp" timestamp(6) NOT NULL DEFAULT clock_timestamp(),
40 "FromID" uuid NOT NULL
41)
42WITH (OIDS=FALSE);
43ALTER TABLE "public"."im_offline" ADD PRIMARY KEY ("ID","PrincipalID","FromID") NOT DEFERRABLE INITIALLY IMMEDIATE;
44
45COMMIT; \ No newline at end of file