aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/XAssetStore.migrations')
-rw-r--r--OpenSim/Data/PGSQL/Resources/XAssetStore.migrations80
1 files changed, 80 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations
new file mode 100644
index 0000000..df9d821
--- /dev/null
+++ b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations
@@ -0,0 +1,80 @@
1# -----------------
2:VERSION 1
3
4BEGIN;
5
6CREATE TABLE XAssetsMeta (
7 "ID" char(36) NOT NULL,
8 "Hash" char(32) NOT NULL,
9 "Name" varchar(64) NOT NULL,
10 "Description" varchar(64) NOT NULL,
11 "AssetType" smallint NOT NULL,
12 "Local" smallint NOT NULL,
13 "Temporary" smallint NOT NULL,
14 "CreateTime" integer NOT NULL,
15 "AccessTime" integer NOT NULL,
16 "AssetFlags" integer NOT NULL,
17 "CreatorID" varchar(128) NOT NULL,
18 PRIMARY KEY ("ID")
19);
20
21CREATE TABLE XAssetsData (
22 "Hash" char(32) NOT NULL,
23 "Data" bytea NOT NULL,
24 PRIMARY KEY ("Hash")
25);
26
27COMMIT;
28
29
30:VERSION 2
31
32BEGIN;
33
34ALTER TABLE xassetsmeta ALTER COLUMN "Local" SET DATA TYPE boolean USING CASE WHEN '0' THEN FALSE ELSE TRUE END;
35ALTER TABLE xassetsmeta ALTER COLUMN "Temporary" SET DATA TYPE boolean USING CASE WHEN '0' THEN FALSE ELSE TRUE END;
36ALTER TABLE xassetsmeta ALTER COLUMN "Hash" SET DATA TYPE char(66);
37ALTER TABLE xassetsdata ALTER COLUMN "Hash" SET DATA TYPE char(66);
38
39COMMIT;
40
41:VERSION 3
42
43BEGIN;
44
45ALTER TABLE xassetsmeta RENAME COLUMN "ID" TO id;
46ALTER TABLE xassetsmeta RENAME COLUMN "Hash" TO hash;
47ALTER TABLE xassetsmeta RENAME COLUMN "Name" TO name;
48ALTER TABLE xassetsmeta RENAME COLUMN "Description" TO description;
49ALTER TABLE xassetsmeta RENAME COLUMN "Local" to local;
50ALTER TABLE xassetsmeta RENAME COLUMN "Temporary" TO temporary;
51ALTER TABLE xassetsmeta RENAME COLUMN "CreateTime" TO create_time;
52ALTER TABLE xassetsmeta RENAME COLUMN "AccessTime" TO access_time;
53ALTER TABLE xassetsmeta RENAME COLUMN "AssetFlags" TO asset_flags;
54ALTER TABLE xassetsmeta RENAME COLUMN "CreatorID" TO creatorid;
55ALTER TABLE xassetsmeta DROP CONSTRAINT xassetsmeta_pkey;
56ALTER TABLE xassetsmeta ADD PRIMARY KEY (id);
57
58
59ALTER TABLE xassetsdata RENAME COLUMN "Hash" TO hash;
60ALTER TABLE xassetsdata RENAME COLUMN "Data" TO data;
61ALTER TABLE xassetsdata DROP CONSTRAINT xassetsdata_pkey;
62ALTER TABLE xassetsdata ADD PRIMARY KEY (hash);
63
64COMMIT;
65
66
67:VERSION 4
68
69BEGIN;
70
71ALTER TABLE xassetsmeta ALTER COLUMN id SET DATA TYPE uuid USING id::uuid;
72ALTER TABLE xassetsmeta ALTER COLUMN hash SET DATA TYPE bytea USING hash::bytea;
73ALTER TABLE xassetsdata ALTER COLUMN hash SET DATA TYPE bytea USING hash::bytea;
74
75COMMIT;
76
77:VERSION 5
78
79BEGIN;
80COMMIT;