diff options
author | AlexRa | 2010-05-06 23:16:36 +0300 |
---|---|---|
committer | AlexRa | 2010-05-16 17:04:50 +0300 |
commit | dfeb9a0b5c07a85ec8aed591206468cee83ce637 (patch) | |
tree | 412dbee487945ed78c9d2598d2310a02c411ef96 /OpenSim/Data/MSSQL/Resources/AssetStore.migrations | |
parent | Migrations for SQLite converted to new format (diff) | |
download | opensim-SC-dfeb9a0b5c07a85ec8aed591206468cee83ce637.zip opensim-SC-dfeb9a0b5c07a85ec8aed591206468cee83ce637.tar.gz opensim-SC-dfeb9a0b5c07a85ec8aed591206468cee83ce637.tar.bz2 opensim-SC-dfeb9a0b5c07a85ec8aed591206468cee83ce637.tar.xz |
MS SQL migrations converted to the new format
Diffstat (limited to 'OpenSim/Data/MSSQL/Resources/AssetStore.migrations')
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/AssetStore.migrations | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/AssetStore.migrations b/OpenSim/Data/MSSQL/Resources/AssetStore.migrations new file mode 100644 index 0000000..beb82b9 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/AssetStore.migrations | |||
@@ -0,0 +1,100 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | CREATE TABLE [assets] ( | ||
4 | [id] [varchar](36) NOT NULL, | ||
5 | [name] [varchar](64) NOT NULL, | ||
6 | [description] [varchar](64) NOT NULL, | ||
7 | [assetType] [tinyint] NOT NULL, | ||
8 | [local] [tinyint] NOT NULL, | ||
9 | [temporary] [tinyint] NOT NULL, | ||
10 | [data] [image] NOT NULL, | ||
11 | PRIMARY KEY CLUSTERED | ||
12 | ( | ||
13 | [id] ASC | ||
14 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
15 | ) ON [PRIMARY] | ||
16 | |||
17 | |||
18 | :VERSION 2 | ||
19 | |||
20 | BEGIN TRANSACTION | ||
21 | |||
22 | CREATE TABLE Tmp_assets | ||
23 | ( | ||
24 | id varchar(36) NOT NULL, | ||
25 | name varchar(64) NOT NULL, | ||
26 | description varchar(64) NOT NULL, | ||
27 | assetType tinyint NOT NULL, | ||
28 | local bit NOT NULL, | ||
29 | temporary bit NOT NULL, | ||
30 | data image NOT NULL | ||
31 | ) ON [PRIMARY] | ||
32 | TEXTIMAGE_ON [PRIMARY] | ||
33 | |||
34 | IF EXISTS(SELECT * FROM assets) | ||
35 | EXEC('INSERT INTO Tmp_assets (id, name, description, assetType, local, temporary, data) | ||
36 | SELECT id, name, description, assetType, CONVERT(bit, local), CONVERT(bit, temporary), data FROM assets WITH (HOLDLOCK TABLOCKX)') | ||
37 | |||
38 | DROP TABLE assets | ||
39 | |||
40 | EXECUTE sp_rename N'Tmp_assets', N'assets', 'OBJECT' | ||
41 | |||
42 | ALTER TABLE dbo.assets ADD CONSTRAINT | ||
43 | PK__assets__id PRIMARY KEY CLUSTERED | ||
44 | ( | ||
45 | id | ||
46 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
47 | |||
48 | COMMIT | ||
49 | |||
50 | |||
51 | :VERSION 3 | ||
52 | |||
53 | BEGIN TRANSACTION | ||
54 | |||
55 | ALTER TABLE assets add create_time integer default 0 | ||
56 | ALTER TABLE assets add access_time integer default 0 | ||
57 | |||
58 | COMMIT | ||
59 | |||
60 | |||
61 | :VERSION 4 | ||
62 | |||
63 | BEGIN TRANSACTION | ||
64 | |||
65 | CREATE TABLE dbo.Tmp_assets | ||
66 | ( | ||
67 | id uniqueidentifier NOT NULL, | ||
68 | name varchar(64) NOT NULL, | ||
69 | description varchar(64) NOT NULL, | ||
70 | assetType tinyint NOT NULL, | ||
71 | local bit NOT NULL, | ||
72 | temporary bit NOT NULL, | ||
73 | data image NOT NULL, | ||
74 | create_time int NULL, | ||
75 | access_time int NULL | ||
76 | ) ON [PRIMARY] | ||
77 | TEXTIMAGE_ON [PRIMARY] | ||
78 | |||
79 | IF EXISTS(SELECT * FROM dbo.assets) | ||
80 | EXEC('INSERT INTO dbo.Tmp_assets (id, name, description, assetType, local, temporary, data, create_time, access_time) | ||
81 | SELECT CONVERT(uniqueidentifier, id), name, description, assetType, local, temporary, data, create_time, access_time FROM dbo.assets WITH (HOLDLOCK TABLOCKX)') | ||
82 | |||
83 | DROP TABLE assets | ||
84 | |||
85 | EXECUTE sp_rename N'Tmp_assets', N'assets', 'OBJECT' | ||
86 | |||
87 | ALTER TABLE dbo.assets ADD CONSTRAINT | ||
88 | PK__assets__id PRIMARY KEY CLUSTERED | ||
89 | ( | ||
90 | id | ||
91 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
92 | |||
93 | COMMIT | ||
94 | |||
95 | |||
96 | :VERSION 5 | ||
97 | |||
98 | DELETE FROM assets WHERE id = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621'; | ||
99 | |||
100 | |||