aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/FriendsStore.migrations')
-rw-r--r--OpenSim/Data/PGSQL/Resources/FriendsStore.migrations44
1 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations b/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations
new file mode 100644
index 0000000..a87199b
--- /dev/null
+++ b/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations
@@ -0,0 +1,44 @@
1:VERSION 1
2
3BEGIN TRANSACTION;
4
5CREATE TABLE Friends (
6"PrincipalID" uuid NOT NULL,
7"Friend" varchar(255) NOT NULL,
8"Flags" char(16) NOT NULL DEFAULT '0',
9"Offered" varchar(32) NOT NULL DEFAULT 0);
10
11
12COMMIT;
13
14:VERSION 2
15
16BEGIN TRANSACTION;
17
18INSERT INTO Friends ("PrincipalID", "Friend", "Flags", "Offered")
19SELECT "ownerID", "friendID", "friendPerms", 0 FROM userfriends;
20
21COMMIT;
22
23:VERSION 3
24
25BEGIN TRANSACTION;
26
27CREATE TABLE Tmp_Friends
28 ("PrincipalID" varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
29 "Friend" varchar(255) NOT NULL,
30 "Flags" char(16) NOT NULL DEFAULT '0',
31 "Offered" varchar(32) NOT NULL DEFAULT 0) ;
32
33INSERT INTO Tmp_Friends ("PrincipalID", "Friend", "Flags", "Offered")
34 SELECT cast("PrincipalID" as varchar(255)), "Friend", "Flags", "Offered" FROM Friends ;
35
36DROP TABLE Friends;
37
38Alter table Tmp_Friends
39 rename to Friends;
40
41ALTER TABLE Friends ADD PRIMARY KEY("PrincipalID", "Friend");
42
43
44COMMIT;