diff options
author | BlueWall | 2014-10-12 10:50:32 -0400 |
---|---|---|
committer | BlueWall | 2014-10-12 10:50:32 -0400 |
commit | 300e78bfd57b9ca48daa5e11f4bbe4a5abfd1e9c (patch) | |
tree | ee19b157d2089302e41e44302611956c35e92c73 /OpenSim/Data/PGSQL/Resources/XAssetStore.migrations | |
parent | Fix some errors in PgSQL XAssets by changing some data types. Also make sql q... (diff) | |
download | opensim-SC-300e78bfd57b9ca48daa5e11f4bbe4a5abfd1e9c.zip opensim-SC-300e78bfd57b9ca48daa5e11f4bbe4a5abfd1e9c.tar.gz opensim-SC-300e78bfd57b9ca48daa5e11f4bbe4a5abfd1e9c.tar.bz2 opensim-SC-300e78bfd57b9ca48daa5e11f4bbe4a5abfd1e9c.tar.xz |
Make column names lower-case, change hash column type to bytea and remove old commented lines of code
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/XAssetStore.migrations')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/XAssetStore.migrations | 45 |
1 files changed, 45 insertions, 0 deletions
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 | |||
36 | ALTER TABLE xassetsmeta ALTER COLUMN "Hash" SET DATA TYPE char(66); | 36 | ALTER TABLE xassetsmeta ALTER COLUMN "Hash" SET DATA TYPE char(66); |
37 | ALTER TABLE xassetsdata ALTER COLUMN "Hash" SET DATA TYPE char(66); | 37 | ALTER TABLE xassetsdata ALTER COLUMN "Hash" SET DATA TYPE char(66); |
38 | 38 | ||
39 | COMMIT; | ||
40 | |||
41 | :VERSION 3 | ||
42 | |||
43 | BEGIN; | ||
44 | |||
45 | ALTER TABLE xassetsmeta RENAME COLUMN "ID" TO id; | ||
46 | ALTER TABLE xassetsmeta RENAME COLUMN "Hash" TO hash; | ||
47 | ALTER TABLE xassetsmeta RENAME COLUMN "Name" TO name; | ||
48 | ALTER TABLE xassetsmeta RENAME COLUMN "Description" TO description; | ||
49 | ALTER TABLE xassetsmeta RENAME COLUMN "Local" to local; | ||
50 | ALTER TABLE xassetsmeta RENAME COLUMN "Temporary" TO temporary; | ||
51 | ALTER TABLE xassetsmeta RENAME COLUMN "CreateTime" TO create_time; | ||
52 | ALTER TABLE xassetsmeta RENAME COLUMN "AccessTime" TO access_time; | ||
53 | ALTER TABLE xassetsmeta RENAME COLUMN "AssetFlags" TO asset_flags; | ||
54 | ALTER TABLE xassetsmeta RENAME COLUMN "CreatorID" TO creatorid; | ||
55 | ALTER TABLE xassetsmeta DROP CONSTRAINT xassetsmeta_pkey; | ||
56 | ALTER TABLE xassetsmeta ADD PRIMARY KEY (id); | ||
57 | |||
58 | |||
59 | ALTER TABLE xassetsdata RENAME COLUMN "Hash" TO hash; | ||
60 | ALTER TABLE xassetsdata RENAME COLUMN "Data" TO data; | ||
61 | ALTER TABLE xassetsdata DROP CONSTRAINT xassetsdata_pkey; | ||
62 | ALTER TABLE xassetsdata ADD PRIMARY KEY (hash); | ||
63 | |||
64 | COMMIT; | ||
65 | |||
66 | |||
67 | :VERSION 4 | ||
68 | |||
69 | BEGIN; | ||
70 | |||
71 | ;; This is a harsh way of migrating these columns to | ||
72 | ;; a different data type, but it didn't work otherwise | ||
73 | ;; and we have a strict warning when using the module | ||
74 | ;; so here we go ... | ||
75 | |||
76 | ALTER TABLE xassetsmeta DROP COLUMN hash; | ||
77 | ALTER TABLE xassetsmeta ADD COLUMN hash bytea NOT NULL; | ||
78 | |||
79 | ALTER TABLE xassetsdata DROP CONSTRAINT xassetsdata_pkey; | ||
80 | ALTER TABLE xassetsdata DROP COLUMN hash; | ||
81 | ALTER TABLE xassetsdata ADD COLUMN hash bytea NOT NULL; | ||
82 | ALTER TABLE xassetsdata ADD PRIMARY KEY (hash); | ||
83 | |||
39 | COMMIT; \ No newline at end of file | 84 | COMMIT; \ No newline at end of file |