[9700] | 1 | /* Upgrade script from HeuristicLab Hive 3.3.8 to 3.3.9 */
|
---|
| 2 |
|
---|
[9485] | 3 | USE [HeuristicLab.Hive-3.3]
|
---|
| 4 |
|
---|
[9492] | 5 | EXEC sp_configure filestream_access_level, 2
|
---|
| 6 | GO
|
---|
| 7 | RECONFIGURE
|
---|
| 8 | GO
|
---|
[9485] | 9 |
|
---|
| 10 | /**********************************************************/
|
---|
| 11 |
|
---|
| 12 | /* Move old Task Data */
|
---|
| 13 |
|
---|
| 14 | CREATE TABLE [dbo].[TaskDataTemp](
|
---|
| 15 | [TaskId] UniqueIdentifier RowGuidCol NOT NULL,
|
---|
| 16 | [Data] VarBinary(MAX) Filestream NOT NULL,
|
---|
| 17 | [LastUpdate] DateTime NOT NULL,
|
---|
| 18 | CONSTRAINT [PK_dbo.TaskDataTemp] PRIMARY KEY ([TaskId])
|
---|
| 19 | )
|
---|
[9492] | 20 |
|
---|
[9485] | 21 | INSERT INTO dbo.TaskDataTemp (TaskId, Data, LastUpdate)
|
---|
| 22 | SELECT TaskId, Data, LastUpdate
|
---|
| 23 | FROM dbo.TaskData
|
---|
| 24 |
|
---|
| 25 | DELETE FROM dbo.TaskData
|
---|
| 26 |
|
---|
| 27 | /* Alter TaskId and Data Column */
|
---|
| 28 |
|
---|
| 29 | ALTER TABLE dbo.TaskData
|
---|
| 30 | ALTER COLUMN [TaskId] ADD RowGuidCol
|
---|
| 31 |
|
---|
| 32 | ALTER TABLE dbo.TaskData
|
---|
| 33 | DROP COLUMN Data
|
---|
| 34 |
|
---|
| 35 | ALTER TABLE dbo.TaskData
|
---|
| 36 | ADD [Data] VarBinary(MAX) Filestream NOT NULL
|
---|
| 37 |
|
---|
| 38 | /* Insert data */
|
---|
| 39 |
|
---|
| 40 | INSERT INTO dbo.TaskData (TaskId, Data, LastUpdate)
|
---|
| 41 | SELECT TaskId, Data, LastUpdate
|
---|
| 42 | FROM dbo.TaskDataTemp
|
---|
| 43 |
|
---|
| 44 | DROP TABLE dbo.TaskDataTemp
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | /**********************************************************/
|
---|
| 48 |
|
---|
| 49 | /* Move old Plugin Data */
|
---|
| 50 |
|
---|
| 51 | CREATE TABLE [dbo].[PluginDataTemp](
|
---|
| 52 | [PluginDataId] UniqueIdentifier RowGuidCol NOT NULL,
|
---|
| 53 | [PluginId] UniqueIdentifier NOT NULL,
|
---|
| 54 | [Data] VarBinary(MAX) FileStream NOT NULL,
|
---|
| 55 | [FileName] VarChar(MAX) NOT NULL,
|
---|
| 56 | CONSTRAINT [PK_dbo.PluginDataTemp] PRIMARY KEY ([PluginDataId])
|
---|
| 57 | )
|
---|
[9492] | 58 |
|
---|
[9485] | 59 | INSERT INTO dbo.PluginDataTemp (PluginDataId, PluginId, Data, [FileName])
|
---|
| 60 | SELECT PluginDataId, PluginId, Data, [FileName]
|
---|
| 61 | FROM dbo.PluginData
|
---|
| 62 |
|
---|
| 63 | DELETE FROM dbo.PluginData
|
---|
| 64 |
|
---|
| 65 | /* Alter Data Column */
|
---|
| 66 |
|
---|
| 67 | ALTER TABLE dbo.PluginData
|
---|
| 68 | DROP COLUMN Data
|
---|
| 69 |
|
---|
| 70 | ALTER TABLE dbo.PluginData
|
---|
| 71 | ADD [Data] VarBinary(MAX) Filestream NOT NULL
|
---|
| 72 |
|
---|
| 73 | /* Insert data */
|
---|
| 74 |
|
---|
| 75 | INSERT INTO dbo.PluginData (PluginDataId, PluginId, Data, [FileName])
|
---|
| 76 | SELECT PluginDataId, PluginId, Data, [FileName]
|
---|
| 77 | FROM dbo.PluginDataTemp
|
---|
| 78 |
|
---|
| 79 | DROP TABLE dbo.PluginDataTemp |
---|