diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/AssetStore.migrations | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/AssetStore.migrations b/OpenSim/Data/PGSQL/Resources/AssetStore.migrations new file mode 100644 index 0000000..7a858b4 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/AssetStore.migrations | |||
@@ -0,0 +1,99 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | CREATE TABLE assets ( | ||
4 | "id" varchar(36) NOT NULL PRIMARY KEY, | ||
5 | "name" varchar(64) NOT NULL, | ||
6 | "description" varchar(64) NOT NULL, | ||
7 | "assetType" smallint NOT NULL, | ||
8 | "local" smallint NOT NULL, | ||
9 | "temporary" smallint NOT NULL, | ||
10 | "data" bytea NOT NULL | ||
11 | ) ; | ||
12 | |||
13 | :VERSION 2 | ||
14 | |||
15 | BEGIN TRANSACTION; | ||
16 | |||
17 | CREATE TABLE Tmp_assets | ||
18 | ( | ||
19 | "id" varchar(36) NOT NULL, | ||
20 | "name" varchar(64) NOT NULL, | ||
21 | "description" varchar(64) NOT NULL, | ||
22 | "assetType" smallint NOT NULL, | ||
23 | "local" boolean NOT NULL, | ||
24 | "temporary" boolean NOT NULL, | ||
25 | "data" bytea NOT NULL | ||
26 | ) ; | ||
27 | |||
28 | INSERT INTO Tmp_assets ("id", "name", "description", "assetType", "local", "temporary", "data") | ||
29 | SELECT "id", "name", "description", "assetType", case when "local" = 1 then true else false end, case when "temporary" = 1 then true else false end, "data" | ||
30 | FROM assets ; | ||
31 | |||
32 | DROP TABLE assets; | ||
33 | |||
34 | Alter table Tmp_assets | ||
35 | rename to assets; | ||
36 | |||
37 | ALTER TABLE assets ADD PRIMARY KEY ("id"); | ||
38 | |||
39 | COMMIT; | ||
40 | |||
41 | |||
42 | :VERSION 3 | ||
43 | |||
44 | BEGIN TRANSACTION; | ||
45 | |||
46 | ALTER TABLE assets add "create_time" integer default 0; | ||
47 | ALTER TABLE assets add "access_time" integer default 0; | ||
48 | |||
49 | COMMIT; | ||
50 | |||
51 | |||
52 | :VERSION 4 | ||
53 | |||
54 | BEGIN TRANSACTION; | ||
55 | |||
56 | CREATE TABLE Tmp_assets | ||
57 | ( | ||
58 | "id" uuid NOT NULL, | ||
59 | "name" varchar(64) NOT NULL, | ||
60 | "description" varchar(64) NOT NULL, | ||
61 | "assetType" smallint NOT NULL, | ||
62 | "local" boolean NOT NULL, | ||
63 | "temporary" boolean NOT NULL, | ||
64 | "data" bytea NOT NULL, | ||
65 | "create_time" int NULL, | ||
66 | "access_time" int NULL | ||
67 | ) ; | ||
68 | |||
69 | |||
70 | INSERT INTO Tmp_assets ("id", "name", "description", "assetType", "local", "temporary", "data", "create_time", "access_time") | ||
71 | SELECT cast("id" as uuid), "name", "description", "assetType", "local", "temporary", "data", "create_time", "access_time" | ||
72 | FROM assets ; | ||
73 | |||
74 | DROP TABLE assets; | ||
75 | |||
76 | Alter table Tmp_assets | ||
77 | rename to assets; | ||
78 | |||
79 | ALTER TABLE assets ADD PRIMARY KEY ("id"); | ||
80 | |||
81 | COMMIT; | ||
82 | |||
83 | |||
84 | :VERSION 5 | ||
85 | |||
86 | DELETE FROM assets WHERE "id" = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621'; | ||
87 | |||
88 | :VERSION 6 | ||
89 | |||
90 | ALTER TABLE assets ADD "asset_flags" INTEGER NOT NULL DEFAULT 0; | ||
91 | |||
92 | :VERSION 7 | ||
93 | |||
94 | alter table assets add "creatorid" varchar(36) not null default ''; | ||
95 | |||
96 | :VERSION 8 | ||
97 | |||
98 | BEGIN TRANSACTION; | ||
99 | COMMIT; | ||