aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations
blob: 1513cc3b19bed9201aa121858132673bc3f71aca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -----------------
:VERSION 1

BEGIN;

CREATE TABLE XAssetsMeta (
  "ID" char(36) NOT NULL,
  "Hash" char(32) NOT NULL,
  "Name" varchar(64) NOT NULL,
  "Description" varchar(64) NOT NULL,
  "AssetType" smallint NOT NULL,
  "Local" smallint NOT NULL,
  "Temporary" smallint NOT NULL,
  "CreateTime" integer NOT NULL,
  "AccessTime" integer NOT NULL,
  "AssetFlags" integer NOT NULL,
  "CreatorID" varchar(128) NOT NULL,
  PRIMARY KEY ("ID")
);

CREATE TABLE XAssetsData (
  "Hash" char(32) NOT NULL,
  "Data" bytea NOT NULL,
  PRIMARY KEY ("Hash")
);

COMMIT;


:VERSION 2

BEGIN;

ALTER TABLE xassetsmeta ALTER COLUMN "Local" SET DATA TYPE boolean USING CASE WHEN '0' THEN FALSE ELSE TRUE END;
ALTER TABLE xassetsmeta ALTER COLUMN "Temporary" SET DATA TYPE boolean USING CASE WHEN '0' THEN FALSE ELSE TRUE END;
ALTER TABLE xassetsmeta ALTER COLUMN "Hash" SET DATA TYPE char(66);
ALTER TABLE xassetsdata ALTER COLUMN "Hash" SET DATA TYPE char(66);

COMMIT;