diff options
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/FriendsStore.migrations')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/FriendsStore.migrations | 44 |
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 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE 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 | |||
12 | COMMIT; | ||
13 | |||
14 | :VERSION 2 | ||
15 | |||
16 | BEGIN TRANSACTION; | ||
17 | |||
18 | INSERT INTO Friends ("PrincipalID", "Friend", "Flags", "Offered") | ||
19 | SELECT "ownerID", "friendID", "friendPerms", 0 FROM userfriends; | ||
20 | |||
21 | COMMIT; | ||
22 | |||
23 | :VERSION 3 | ||
24 | |||
25 | BEGIN TRANSACTION; | ||
26 | |||
27 | CREATE 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 | |||
33 | INSERT INTO Tmp_Friends ("PrincipalID", "Friend", "Flags", "Offered") | ||
34 | SELECT cast("PrincipalID" as varchar(255)), "Friend", "Flags", "Offered" FROM Friends ; | ||
35 | |||
36 | DROP TABLE Friends; | ||
37 | |||
38 | Alter table Tmp_Friends | ||
39 | rename to Friends; | ||
40 | |||
41 | ALTER TABLE Friends ADD PRIMARY KEY("PrincipalID", "Friend"); | ||
42 | |||
43 | |||
44 | COMMIT; | ||