diff options
Diffstat (limited to 'OpenSim/Data/MSSQL/Resources')
11 files changed, 76 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/AssetStore.migrations b/OpenSim/Data/MSSQL/Resources/AssetStore.migrations index beb82b9..8664ce9 100644 --- a/OpenSim/Data/MSSQL/Resources/AssetStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/AssetStore.migrations | |||
@@ -97,4 +97,10 @@ COMMIT | |||
97 | 97 | ||
98 | DELETE FROM assets WHERE id = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621'; | 98 | DELETE FROM assets WHERE id = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621'; |
99 | 99 | ||
100 | :VERSION 6 | ||
100 | 101 | ||
102 | ALTER TABLE assets ADD asset_flags INTEGER NOT NULL DEFAULT 0; | ||
103 | |||
104 | :VERSION 7 | ||
105 | |||
106 | alter table assets add creatorid varchar(36) not null default ''; | ||
diff --git a/OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql b/OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/AvatarAppearance.sql +++ /dev/null | |||
diff --git a/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql b/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql +++ /dev/null | |||
diff --git a/OpenSim/Data/MSSQL/Resources/CreateFoldersTable.sql b/OpenSim/Data/MSSQL/Resources/CreateFoldersTable.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/CreateFoldersTable.sql +++ /dev/null | |||
diff --git a/OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql b/OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/CreateItemsTable.sql +++ /dev/null | |||
diff --git a/OpenSim/Data/MSSQL/Resources/CreateUserFriendsTable.sql b/OpenSim/Data/MSSQL/Resources/CreateUserFriendsTable.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/CreateUserFriendsTable.sql +++ /dev/null | |||
diff --git a/OpenSim/Data/MSSQL/Resources/InventoryStore.migrations b/OpenSim/Data/MSSQL/Resources/InventoryStore.migrations index cd5dfdc..e2a8d57 100644 --- a/OpenSim/Data/MSSQL/Resources/InventoryStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/InventoryStore.migrations | |||
@@ -171,4 +171,74 @@ CREATE NONCLUSTERED INDEX folder ON dbo.inventoryitems | |||
171 | 171 | ||
172 | COMMIT | 172 | COMMIT |
173 | 173 | ||
174 | :VERSION 5 | ||
175 | |||
176 | # It would be totally crazy to have to recreate the whole table just to change one column type, | ||
177 | # just because MS SQL treats each DEFAULT as a constraint object that must be dropped | ||
178 | # before anything can be done to the column. Since all defaults here are unnamed, there is | ||
179 | # no easy way to drop them! The hairy piece of code below removes all DEFAULT constraints | ||
180 | # from InventoryItems. | ||
181 | |||
182 | # SO: anything that's NULLable is by default NULL, so please don't declare DEFAULT(NULL), | ||
183 | # they do nothing but prevent changes to the columns. If you really | ||
184 | # need to have DEFAULTs or other constraints, give them names so they can be dropped when needed! | ||
185 | |||
186 | BEGIN TRANSACTION | ||
187 | DECLARE @nm varchar(80); | ||
188 | DECLARE x CURSOR LOCAL FORWARD_ONLY READ_ONLY | ||
189 | FOR SELECT name FROM sys.default_constraints where parent_object_id = OBJECT_ID('inventoryitems'); | ||
190 | OPEN x; | ||
191 | FETCH NEXT FROM x INTO @nm; | ||
192 | WHILE @@FETCH_STATUS = 0 | ||
193 | BEGIN | ||
194 | EXEC('alter table inventoryitems drop ' + @nm); | ||
195 | FETCH NEXT FROM x INTO @nm; | ||
196 | END | ||
197 | CLOSE x | ||
198 | DEALLOCATE x | ||
199 | COMMIT | ||
200 | |||
201 | # all DEFAULTs dropped! | ||
202 | |||
203 | :GO | ||
204 | |||
205 | BEGIN TRANSACTION | ||
206 | |||
207 | # Restoring defaults: | ||
208 | # NOTE: [inventoryID] does NOT need one: it's NOT NULL PK and a unique Guid must be provided every time anyway! | ||
209 | |||
210 | alter table inventoryitems | ||
211 | add constraint def_baseperm default 0 for inventoryBasePermissions | ||
212 | alter table inventoryitems | ||
213 | add constraint def_allperm default 0 for inventoryEveryOnePermissions | ||
214 | alter table inventoryitems | ||
215 | add constraint def_grpperm default 0 for inventoryGroupPermissions | ||
216 | |||
217 | COMMIT | ||
218 | |||
219 | :VERSION 7 | ||
220 | |||
221 | BEGIN TRANSACTION | ||
222 | |||
223 | # CreatorID goes back to VARCHAR(36) (???) | ||
224 | |||
225 | exec sp_rename 'inventoryitems.CreatorID', 'cr_old', 'COLUMN' | ||
226 | |||
227 | :GO | ||
228 | |||
229 | alter table inventoryitems | ||
230 | add creatorID varchar(36) NULL | ||
231 | |||
232 | :GO | ||
233 | |||
234 | update inventoryitems set creatorID = CONVERT(VARCHAR(36), cr_old) | ||
235 | |||
236 | alter table inventoryitems | ||
237 | drop column cr_old | ||
238 | |||
239 | COMMIT | ||
240 | |||
241 | |||
242 | |||
243 | |||
174 | 244 | ||
diff --git a/OpenSim/Data/MSSQL/Resources/Mssql-agents.sql b/OpenSim/Data/MSSQL/Resources/Mssql-agents.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/Mssql-agents.sql +++ /dev/null | |||
diff --git a/OpenSim/Data/MSSQL/Resources/Mssql-logs.sql b/OpenSim/Data/MSSQL/Resources/Mssql-logs.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/Mssql-logs.sql +++ /dev/null | |||
diff --git a/OpenSim/Data/MSSQL/Resources/Mssql-regions.sql b/OpenSim/Data/MSSQL/Resources/Mssql-regions.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/Mssql-regions.sql +++ /dev/null | |||
diff --git a/OpenSim/Data/MSSQL/Resources/Mssql-users.sql b/OpenSim/Data/MSSQL/Resources/Mssql-users.sql deleted file mode 100644 index e69de29..0000000 --- a/OpenSim/Data/MSSQL/Resources/Mssql-users.sql +++ /dev/null | |||