diff options
author | AlexRa | 2010-05-01 17:43:10 +0300 |
---|---|---|
committer | AlexRa | 2010-05-16 17:04:13 +0300 |
commit | ee713cb253c1ef2d09de235964e02e7621649dd8 (patch) | |
tree | b85373e71ddc2ece69726ea60c0f636ccc302c72 /OpenSim/Data/MySQL/Resources/AssetStore.migrations | |
parent | Added MySqlMigrations.cs (supports stored proc/funcs) (diff) | |
download | opensim-SC-ee713cb253c1ef2d09de235964e02e7621649dd8.zip opensim-SC-ee713cb253c1ef2d09de235964e02e7621649dd8.tar.gz opensim-SC-ee713cb253c1ef2d09de235964e02e7621649dd8.tar.bz2 opensim-SC-ee713cb253c1ef2d09de235964e02e7621649dd8.tar.xz |
Converted MySQL migration history to the new format
Replaced all NNN_StoreName.sql migration resources with a more
readable, single-file-per-store
Diffstat (limited to 'OpenSim/Data/MySQL/Resources/AssetStore.migrations')
-rw-r--r-- | OpenSim/Data/MySQL/Resources/AssetStore.migrations | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/Resources/AssetStore.migrations b/OpenSim/Data/MySQL/Resources/AssetStore.migrations new file mode 100644 index 0000000..b9595f0 --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/AssetStore.migrations | |||
@@ -0,0 +1,69 @@ | |||
1 | # ----------------- | ||
2 | :VERSION 1 | ||
3 | |||
4 | BEGIN; | ||
5 | |||
6 | CREATE TABLE `assets` ( | ||
7 | `id` binary(16) NOT NULL, | ||
8 | `name` varchar(64) NOT NULL, | ||
9 | `description` varchar(64) NOT NULL, | ||
10 | `assetType` tinyint(4) NOT NULL, | ||
11 | `invType` tinyint(4) NOT NULL, | ||
12 | `local` tinyint(1) NOT NULL, | ||
13 | `temporary` tinyint(1) NOT NULL, | ||
14 | `data` longblob NOT NULL, | ||
15 | PRIMARY KEY (`id`) | ||
16 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; | ||
17 | |||
18 | COMMIT; | ||
19 | |||
20 | # ----------------- | ||
21 | :VERSION 2 | ||
22 | |||
23 | BEGIN; | ||
24 | |||
25 | ALTER TABLE assets change id oldid binary(16); | ||
26 | ALTER TABLE assets add id varchar(36) not null default ''; | ||
27 | UPDATE assets set id = concat(substr(hex(oldid),1,8),"-",substr(hex(oldid),9,4),"-",substr(hex(oldid),13,4),"-",substr(hex(oldid),17,4),"-",substr(hex(oldid),21,12)); | ||
28 | ALTER TABLE assets drop oldid; | ||
29 | ALTER TABLE assets add constraint primary key(id); | ||
30 | |||
31 | COMMIT; | ||
32 | |||
33 | # ----------------- | ||
34 | :VERSION 3 | ||
35 | |||
36 | BEGIN; | ||
37 | |||
38 | ALTER TABLE assets change id oldid varchar(36); | ||
39 | ALTER TABLE assets add id char(36) not null default '00000000-0000-0000-0000-000000000000'; | ||
40 | UPDATE assets set id = oldid; | ||
41 | ALTER TABLE assets drop oldid; | ||
42 | ALTER TABLE assets add constraint primary key(id); | ||
43 | |||
44 | COMMIT; | ||
45 | |||
46 | # ----------------- | ||
47 | :VERSION 4 | ||
48 | |||
49 | BEGIN; | ||
50 | |||
51 | ALTER TABLE assets drop InvType; | ||
52 | |||
53 | COMMIT; | ||
54 | |||
55 | # ----------------- | ||
56 | :VERSION 5 | ||
57 | |||
58 | BEGIN; | ||
59 | |||
60 | ALTER TABLE assets add create_time integer default 0; | ||
61 | ALTER TABLE assets add access_time integer default 0; | ||
62 | |||
63 | COMMIT; | ||
64 | |||
65 | # ----------------- | ||
66 | :VERSION 6 | ||
67 | |||
68 | DELETE FROM assets WHERE id = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621' | ||
69 | |||