diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/Avatar.migrations | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/Avatar.migrations b/OpenSim/Data/PGSQL/Resources/Avatar.migrations new file mode 100644 index 0000000..160086d --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/Avatar.migrations | |||
@@ -0,0 +1,59 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE Avatars ( | ||
6 | "PrincipalID" uuid NOT NULL PRIMARY KEY, | ||
7 | "Name" varchar(32) NOT NULL, | ||
8 | "Value" varchar(255) NOT NULL DEFAULT '' | ||
9 | ); | ||
10 | |||
11 | |||
12 | COMMIT; | ||
13 | |||
14 | :VERSION 2 | ||
15 | |||
16 | BEGIN TRANSACTION; | ||
17 | |||
18 | CREATE TABLE Tmp_Avatars | ||
19 | ( | ||
20 | "PrincipalID" uuid NOT NULL, | ||
21 | "Name" varchar(32) NOT NULL, | ||
22 | "Value" text NOT NULL DEFAULT '' | ||
23 | ) ; | ||
24 | |||
25 | INSERT INTO Tmp_Avatars ("PrincipalID", "Name", "Value") | ||
26 | SELECT "PrincipalID", cast("Name" as text), "Value" | ||
27 | FROM Avatars ; | ||
28 | |||
29 | DROP TABLE Avatars; | ||
30 | |||
31 | Alter table Tmp_Avatars | ||
32 | rename to Avatars; | ||
33 | |||
34 | COMMIT; | ||
35 | |||
36 | :VERSION 3 | ||
37 | |||
38 | BEGIN TRANSACTION; | ||
39 | |||
40 | CREATE TABLE Tmp_Avatars | ||
41 | ( | ||
42 | "PrincipalID" uuid NOT NULL, | ||
43 | "Name" varchar(32) NOT NULL, | ||
44 | "Value" text NOT NULL DEFAULT '' | ||
45 | ); | ||
46 | |||
47 | ALTER TABLE Tmp_Avatars ADD PRIMARY KEY ("PrincipalID", "Name"); | ||
48 | |||
49 | |||
50 | INSERT INTO Tmp_Avatars ("PrincipalID", "Name", "Value") | ||
51 | SELECT "PrincipalID", "Name", cast("Value" as text) FROM Avatars ; | ||
52 | |||
53 | DROP TABLE Avatars; | ||
54 | |||
55 | Alter table Tmp_Avatars | ||
56 | rename to Avatars; | ||
57 | |||
58 | COMMIT; | ||
59 | |||