aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/GridUserStore.migrations
blob: d37c4f6d725141ab7f5633a16e0d4821208fb697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
:VERSION 1         # -------------------------- 

BEGIN TRANSACTION;

CREATE TABLE GridUser (
    "UserID" VARCHAR(255) NOT NULL Primary Key,
    "HomeRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
    "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
    "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
    "LastRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
    "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
    "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
    "Online" CHAR(5) NOT NULL DEFAULT 'false',
    "Login" CHAR(16) NOT NULL DEFAULT '0',
    "Logout" CHAR(16) NOT NULL DEFAULT '0'
) ;

COMMIT;

:VERSION 2         # -------------------------- 

BEGIN TRANSACTION;

CREATE TABLE GridUser_tmp (
    "UserID" VARCHAR(255) NOT NULL PRIMARY KEY,
    "HomeRegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
    "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
    "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
    "LastRegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
    "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
    "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
    "Online" CHAR(5) NOT NULL DEFAULT 'false',
    "Login" CHAR(16) NOT NULL DEFAULT '0',
    "Logout" CHAR(16) NOT NULL DEFAULT '0'
    );

COMMIT;


INSERT INTO GridUser_tmp ("UserID"
           ,"HomeRegionID"
           ,"HomePosition"
           ,"HomeLookAt"
           ,"LastRegionID"
           ,"LastPosition"
           ,"LastLookAt"
           ,"Online"
           ,"Login"
           ,"Logout")
 SELECT "UserID", cast("HomeRegionID" as uuid), "HomePosition" ,"HomeLookAt" , cast("LastRegionID" as uuid),
       "LastPosition"
      ,"LastLookAt"
      ,"Online"
      ,"Login"
      ,"Logout" FROM GridUser;

DROP TABLE GridUser;

alter table GridUser_tmp rename to GridUser;