|
1 |
# -------------------------------------------------------------------------- #
|
|
2 |
# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs #
|
|
3 |
# #
|
|
4 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
5 |
# not use this file except in compliance with the License. You may obtain #
|
|
6 |
# a copy of the License at #
|
|
7 |
# #
|
|
8 |
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
9 |
# #
|
|
10 |
# Unless required by applicable law or agreed to in writing, software #
|
|
11 |
# distributed under the License is distributed on an "AS IS" BASIS, #
|
|
12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
|
13 |
# See the License for the specific language governing permissions and #
|
|
14 |
# limitations under the License. #
|
|
15 |
#--------------------------------------------------------------------------- #
|
|
16 |
|
|
17 |
module Migrator
|
|
18 |
def db_version
|
|
19 |
"3.8.4"
|
|
20 |
end
|
|
21 |
|
|
22 |
def one_version
|
|
23 |
"OpenNebula 3.8.4"
|
|
24 |
end
|
|
25 |
|
|
26 |
def up
|
|
27 |
|
|
28 |
########################################################################
|
|
29 |
# Bug #1813: change body column type from TEXT to MEDIUMTEXT
|
|
30 |
########################################################################
|
|
31 |
|
|
32 |
# Sqlite does not support alter table modify column, but the TEXT column
|
|
33 |
# is enough in sqlite.
|
|
34 |
|
|
35 |
if !@sqlite_file
|
|
36 |
@db.run "ALTER TABLE cluster_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
37 |
@db.run "ALTER TABLE datastore_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
38 |
@db.run "ALTER TABLE document_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
39 |
@db.run "ALTER TABLE group_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
40 |
@db.run "ALTER TABLE history MODIFY COLUMN body MEDIUMTEXT;"
|
|
41 |
@db.run "ALTER TABLE host_monitoring MODIFY COLUMN body MEDIUMTEXT;"
|
|
42 |
@db.run "ALTER TABLE host_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
43 |
@db.run "ALTER TABLE image_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
44 |
@db.run "ALTER TABLE leases MODIFY COLUMN body MEDIUMTEXT;"
|
|
45 |
@db.run "ALTER TABLE network_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
46 |
@db.run "ALTER TABLE template_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
47 |
@db.run "ALTER TABLE user_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
48 |
@db.run "ALTER TABLE vm_monitoring MODIFY COLUMN body MEDIUMTEXT;"
|
|
49 |
@db.run "ALTER TABLE vm_pool MODIFY COLUMN body MEDIUMTEXT;"
|
|
50 |
end
|
|
51 |
|
|
52 |
return true
|
|
53 |
end
|
|
54 |
end
|