From 300e78bfd57b9ca48daa5e11f4bbe4a5abfd1e9c Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 12 Oct 2014 10:50:32 -0400 Subject: Make column names lower-case, change hash column type to bytea and remove old commented lines of code --- .../Data/PGSQL/Resources/XAssetStore.migrations | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'OpenSim/Data/PGSQL/Resources') diff --git a/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations index 1513cc3..8fb3656 100644 --- a/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations +++ b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations @@ -36,4 +36,49 @@ ALTER TABLE xassetsmeta ALTER COLUMN "Temporary" SET DATA TYPE boolean USING CAS ALTER TABLE xassetsmeta ALTER COLUMN "Hash" SET DATA TYPE char(66); ALTER TABLE xassetsdata ALTER COLUMN "Hash" SET DATA TYPE char(66); +COMMIT; + +:VERSION 3 + +BEGIN; + +ALTER TABLE xassetsmeta RENAME COLUMN "ID" TO id; +ALTER TABLE xassetsmeta RENAME COLUMN "Hash" TO hash; +ALTER TABLE xassetsmeta RENAME COLUMN "Name" TO name; +ALTER TABLE xassetsmeta RENAME COLUMN "Description" TO description; +ALTER TABLE xassetsmeta RENAME COLUMN "Local" to local; +ALTER TABLE xassetsmeta RENAME COLUMN "Temporary" TO temporary; +ALTER TABLE xassetsmeta RENAME COLUMN "CreateTime" TO create_time; +ALTER TABLE xassetsmeta RENAME COLUMN "AccessTime" TO access_time; +ALTER TABLE xassetsmeta RENAME COLUMN "AssetFlags" TO asset_flags; +ALTER TABLE xassetsmeta RENAME COLUMN "CreatorID" TO creatorid; +ALTER TABLE xassetsmeta DROP CONSTRAINT xassetsmeta_pkey; +ALTER TABLE xassetsmeta ADD PRIMARY KEY (id); + + +ALTER TABLE xassetsdata RENAME COLUMN "Hash" TO hash; +ALTER TABLE xassetsdata RENAME COLUMN "Data" TO data; +ALTER TABLE xassetsdata DROP CONSTRAINT xassetsdata_pkey; +ALTER TABLE xassetsdata ADD PRIMARY KEY (hash); + +COMMIT; + + +:VERSION 4 + +BEGIN; + +;; This is a harsh way of migrating these columns to +;; a different data type, but it didn't work otherwise +;; and we have a strict warning when using the module +;; so here we go ... + +ALTER TABLE xassetsmeta DROP COLUMN hash; +ALTER TABLE xassetsmeta ADD COLUMN hash bytea NOT NULL; + +ALTER TABLE xassetsdata DROP CONSTRAINT xassetsdata_pkey; +ALTER TABLE xassetsdata DROP COLUMN hash; +ALTER TABLE xassetsdata ADD COLUMN hash bytea NOT NULL; +ALTER TABLE xassetsdata ADD PRIMARY KEY (hash); + COMMIT; \ No newline at end of file -- cgit v1.1