aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/AssetStore.migrations
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/AssetStore.migrations')
-rw-r--r--OpenSim/Data/PGSQL/Resources/AssetStore.migrations99
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
3CREATE 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
15BEGIN TRANSACTION;
16
17CREATE 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
28INSERT 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
32DROP TABLE assets;
33
34Alter table Tmp_assets
35 rename to assets;
36
37ALTER TABLE assets ADD PRIMARY KEY ("id");
38
39COMMIT;
40
41
42:VERSION 3
43
44BEGIN TRANSACTION;
45
46ALTER TABLE assets add "create_time" integer default 0;
47ALTER TABLE assets add "access_time" integer default 0;
48
49COMMIT;
50
51
52:VERSION 4
53
54BEGIN TRANSACTION;
55
56CREATE 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
70INSERT 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
74DROP TABLE assets;
75
76Alter table Tmp_assets
77 rename to assets;
78
79 ALTER TABLE assets ADD PRIMARY KEY ("id");
80
81COMMIT;
82
83
84:VERSION 5
85
86DELETE FROM assets WHERE "id" = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621';
87
88:VERSION 6
89
90ALTER TABLE assets ADD "asset_flags" INTEGER NOT NULL DEFAULT 0;
91
92:VERSION 7
93
94alter table assets add "creatorid" varchar(36) not null default '';
95
96:VERSION 8
97
98BEGIN TRANSACTION;
99COMMIT;