convert_db.diff

Enziin System, 2018-08-22 13:37

Download (195 KB)

View differences:

db/migrate/001_setup.rb (working copy)
15 15
# along with this program; if not, write to the Free Software
16 16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 17

  
18
class Setup < ActiveRecord::Migration[4.2]
18
class Setup < ActiveRecord::Migration[5.2]
19 19

  
20 20
  class User < ActiveRecord::Base
21 21
  end
......
24 24
  class Permission < ActiveRecord::Base; end
25 25

  
26 26
  def self.up
27
    create_table "attachments", :force => true do |t|
28
      t.column "container_id", :integer, :default => 0, :null => false
29
      t.column "container_type", :string, :limit => 30, :default => "", :null => false
30
      t.column "filename", :string, :default => "", :null => false
31
      t.column "disk_filename", :string, :default => "", :null => false
32
      t.column "filesize", :integer, :default => 0, :null => false
33
      t.column "content_type", :string, :limit => 60, :default => ""
34
      t.column "digest", :string, :limit => 40, :default => "", :null => false
35
      t.column "downloads", :integer, :default => 0, :null => false
36
      t.column "author_id", :integer, :default => 0, :null => false
37
      t.column "created_on", :timestamp
27
    create_table :attachments, force: true do |t|
28
      t.bigint :container_id, default: 0, null: false
29
      t.string :container_type, limit: 30, default: "", null: false
30
      t.string :filename, default: "", null: false
31
      t.string :disk_filename, default: "", null: false
32
      t.integer :filesize, default: 0, null: false
33
      t.string :content_type, limit: 60, default: ""
34
      t.string :digest, limit: 40, default: "", null: false
35
      t.bigint :downloads, default: 0, null: false
36
      t.bigint :author_id, default: 0, null: false
37
      t.datetime :created_on
38 38
    end
39 39

  
40
    create_table "auth_sources", :force => true do |t|
41
      t.column "type", :string, :limit => 30, :default => "", :null => false
42
      t.column "name", :string, :limit => 60, :default => "", :null => false
43
      t.column "host", :string, :limit => 60
44
      t.column "port", :integer
45
      t.column "account", :string, :limit => 60
46
      t.column "account_password", :string, :limit => 60
47
      t.column "base_dn", :string, :limit => 255
48
      t.column "attr_login", :string, :limit => 30
49
      t.column "attr_firstname", :string, :limit => 30
50
      t.column "attr_lastname", :string, :limit => 30
51
      t.column "attr_mail", :string, :limit => 30
52
      t.column "onthefly_register", :boolean, :default => false, :null => false
40
    create_table :auth_sources, force: true do |t|
41
      t.string :type, limit: 30, default: "", null: false
42
      t.string :name, limit: 60, default: "", null: false
43
      t.string :host, limit: 60
44
      t.integer :port
45
      t.string :account, limit: 60
46
      t.string :account_password, limit: 60
47
      t.string :base_dn, limit: 255
48
      t.string :attr_login, limit: 30
49
      t.string :attr_firstname, limit: 30
50
      t.string :attr_lastname, limit: 30
51
      t.string :attr_mail, limit: 30
52
      t.boolean :onthefly_register, default: false, null: false
53 53
    end
54 54

  
55
    create_table "custom_fields", :force => true do |t|
56
      t.column "type", :string, :limit => 30, :default => "", :null => false
57
      t.column "name", :string, :limit => 30, :default => "", :null => false
58
      t.column "field_format", :string, :limit => 30, :default => "", :null => false
59
      t.column "possible_values", :text
60
      t.column "regexp", :string, :default => ""
61
      t.column "min_length", :integer, :default => 0, :null => false
62
      t.column "max_length", :integer, :default => 0, :null => false
63
      t.column "is_required", :boolean, :default => false, :null => false
64
      t.column "is_for_all", :boolean, :default => false, :null => false
55
    create_table :custom_fields, force: true do |t|
56
      t.string :type, limit: 30, default: "", null: false
57
      t.string :name, limit: 30, default: "", null: false
58
      t.string :field_format, limit: 30, default: "", null: false
59
      t.text :possible_values
60
      t.string :regexp, default: ""
61
      t.integer :min_length, default: 0, null: false
62
      t.integer :max_length, default: 0, null: false
63
      t.boolean :is_required, default: false, null: false
64
      t.boolean :is_for_all, default: false, null: false
65 65
    end
66 66

  
67
    create_table "custom_fields_projects", :id => false, :force => true do |t|
68
      t.column "custom_field_id", :integer, :default => 0, :null => false
69
      t.column "project_id", :integer, :default => 0, :null => false
67
    create_table :custom_fields_projects, :id => false, force: true do |t|
68
      t.bigint :custom_field_id, default: 0, null: false
69
      t.bigint :project_id, default: 0, null: false
70 70
    end
71 71

  
72
    create_table "custom_fields_trackers", :id => false, :force => true do |t|
73
      t.column "custom_field_id", :integer, :default => 0, :null => false
74
      t.column "tracker_id", :integer, :default => 0, :null => false
72
    create_table :custom_fields_trackers, :id => false, force: true do |t|
73
      t.bigint :custom_field_id, default: 0, null: false
74
      t.bigint :tracker_id, default: 0, null: false
75 75
    end
76 76

  
77
    create_table "custom_values", :force => true do |t|
78
      t.column "customized_type", :string, :limit => 30, :default => "", :null => false
79
      t.column "customized_id", :integer, :default => 0, :null => false
80
      t.column "custom_field_id", :integer, :default => 0, :null => false
81
      t.column "value", :text
77
    create_table :custom_values, force: true do |t|
78
      t.string :customized_type, limit: 30, default: "", null: false
79
      t.bigint :customized_id, default: 0, null: false
80
      t.bigint :custom_field_id, default: 0, null: false
81
      t.text :value
82 82
    end
83 83

  
84
    create_table "documents", :force => true do |t|
85
      t.column "project_id", :integer, :default => 0, :null => false
86
      t.column "category_id", :integer, :default => 0, :null => false
87
      t.column "title", :string, :limit => 60, :default => "", :null => false
88
      t.column "description", :text
89
      t.column "created_on", :timestamp
84
    create_table :documents, force: true do |t|
85
      t.bigint :project_id, default: 0, null: false
86
      t.bigint :category_id, default: 0, null: false
87
      t.string :title, limit: 60, default: "", null: false
88
      t.text :description
89
      t.datetime :created_on
90 90
    end
91 91

  
92 92
    add_index "documents", ["project_id"], :name => "documents_project_id"
93 93

  
94
    create_table "enumerations", :force => true do |t|
95
      t.column "opt", :string, :limit => 4, :default => "", :null => false
96
      t.column "name", :string, :limit => 30, :default => "", :null => false
94
    create_table :enumerations, force: true do |t|
95
      t.string :opt, limit: 4, default: "", null: false
96
      t.string :name, limit: 30, default: "", null: false
97 97
    end
98 98

  
99
    create_table "issue_categories", :force => true do |t|
100
      t.column "project_id", :integer, :default => 0, :null => false
101
      t.column "name", :string, :limit => 30, :default => "", :null => false
99
    create_table :issue_categories, force: true do |t|
100
      t.bigint :project_id, default: 0, null: false
101
      t.string :name, limit: 30, default: "", null: false
102 102
    end
103 103

  
104 104
    add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id"
105 105

  
106
    create_table "issue_histories", :force => true do |t|
107
      t.column "issue_id", :integer, :default => 0, :null => false
108
      t.column "status_id", :integer, :default => 0, :null => false
109
      t.column "author_id", :integer, :default => 0, :null => false
110
      t.column "notes", :text
111
      t.column "created_on", :timestamp
106
    create_table :issue_histories, force: true do |t|
107
      t.bigint :issue_id, default: 0, null: false
108
      t.bigint :status_id, default: 0, null: false
109
      t.bigint :author_id, default: 0, null: false
110
      t.text :notes
111
      t.datetime :created_on
112 112
    end
113 113

  
114 114
    add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
115 115

  
116
    create_table "issue_statuses", :force => true do |t|
117
      t.column "name", :string, :limit => 30, :default => "", :null => false
118
      t.column "is_closed", :boolean, :default => false, :null => false
119
      t.column "is_default", :boolean, :default => false, :null => false
120
      t.column "html_color", :string, :limit => 6, :default => "FFFFFF", :null => false
116
    create_table :issue_statuses, force: true do |t|
117
      t.string :name, limit: 30, default: "", null: false
118
      t.boolean :is_closed, default: false, null: false
119
      t.boolean :is_default, default: false, null: false
120
      t.string :html_color, limit: 6, default: "FFFFFF", null: false
121 121
    end
122 122

  
123
    create_table "issues", :force => true do |t|
124
      t.column "tracker_id", :integer, :default => 0, :null => false
125
      t.column "project_id", :integer, :default => 0, :null => false
126
      t.column "subject", :string, :default => "", :null => false
127
      t.column "description", :text
128
      t.column "due_date", :date
129
      t.column "category_id", :integer
130
      t.column "status_id", :integer, :default => 0, :null => false
131
      t.column "assigned_to_id", :integer
132
      t.column "priority_id", :integer, :default => 0, :null => false
133
      t.column "fixed_version_id", :integer
134
      t.column "author_id", :integer, :default => 0, :null => false
135
      t.column "lock_version", :integer, :default => 0, :null => false
136
      t.column "created_on", :timestamp
137
      t.column "updated_on", :timestamp
123
    create_table :issues, force: true do |t|
124
      t.bigint :tracker_id, default: 0, null: false
125
      t.bigint :project_id, default: 0, null: false
126
      t.string :subject, default: "", null: false
127
      t.text :description
128
      t.date "due_date"
129
      t.bigint :category_id
130
      t.bigint :status_id, default: 0, null: false
131
      t.bigint :assigned_to_id
132
      t.bigint :priority_id, default: 0, null: false
133
      t.bigint :fixed_version_id
134
      t.bigint :author_id, default: 0, null: false
135
      t.integer :lock_version, default: 0, null: false
136
      t.datetime :created_on
137
      t.datetime :updated_on
138 138
    end
139 139

  
140 140
    add_index "issues", ["project_id"], :name => "issues_project_id"
141 141

  
142
    create_table "members", :force => true do |t|
143
      t.column "user_id", :integer, :default => 0, :null => false
144
      t.column "project_id", :integer, :default => 0, :null => false
145
      t.column "role_id", :integer, :default => 0, :null => false
146
      t.column "created_on", :timestamp
142
    create_table :members, force: true do |t|
143
      t.bigint :user_id, default: 0, null: false
144
      t.bigint :project_id, default: 0, null: false
145
      t.bigint :role_id, default: 0, null: false
146
      t.datetime :created_on
147 147
    end
148 148

  
149
    create_table "news", :force => true do |t|
150
      t.column "project_id", :integer
151
      t.column "title", :string, :limit => 60, :default => "", :null => false
152
      t.column "summary", :string, :limit => 255, :default => ""
153
      t.column "description", :text
154
      t.column "author_id", :integer, :default => 0, :null => false
155
      t.column "created_on", :timestamp
149
    create_table :news, force: true do |t|
150
      t.bigint :project_id
151
      t.string :title, limit: 60, default: "", null: false
152
      t.string :summary, limit: 255, default: ""
153
      t.text :description
154
      t.bigint :author_id, default: 0, null: false
155
      t.datetime :created_on
156 156
    end
157 157

  
158 158
    add_index "news", ["project_id"], :name => "news_project_id"
159 159

  
160
    create_table "permissions", :force => true do |t|
161
      t.column "controller", :string, :limit => 30, :default => "", :null => false
162
      t.column "action", :string, :limit => 30, :default => "", :null => false
163
      t.column "description", :string, :limit => 60, :default => "", :null => false
164
      t.column "is_public", :boolean, :default => false, :null => false
165
      t.column "sort", :integer, :default => 0, :null => false
166
      t.column "mail_option", :boolean, :default => false, :null => false
167
      t.column "mail_enabled", :boolean, :default => false, :null => false
160
    create_table :permissions, force: true do |t|
161
      t.string :controller, limit: 30, default: "", null: false
162
      t.string :action, limit: 30, default: "", null: false
163
      t.string :description, limit: 60, default: "", null: false
164
      t.boolean :is_public, default: false, null: false
165
      t.integer :sort, default: 0, null: false
166
      t.boolean :mail_option, default: false, null: false
167
      t.boolean :mail_enabled, default: false, null: false
168 168
    end
169 169

  
170
    create_table "permissions_roles", :id => false, :force => true do |t|
171
      t.column "permission_id", :integer, :default => 0, :null => false
172
      t.column "role_id", :integer, :default => 0, :null => false
170
    create_table :permissions_roles, :id => false, force: true do |t|
171
      t.bigint :permission_id, default: 0, null: false
172
      t.bigint :role_id, default: 0, null: false
173 173
    end
174 174

  
175 175
    add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
176 176

  
177
    create_table "projects", :force => true do |t|
178
      t.column "name", :string, :limit => 30, :default => "", :null => false
179
      t.column "description", :string, :default => "", :null => false
180
      t.column "homepage", :string, :limit => 60, :default => ""
181
      t.column "is_public", :boolean, :default => true, :null => false
182
      t.column "parent_id", :integer
183
      t.column "projects_count", :integer, :default => 0
184
      t.column "created_on", :timestamp
185
      t.column "updated_on", :timestamp
177
    create_table :projects, force: true do |t|
178
      t.string :name, limit: 30, default: "", null: false
179
      t.string :description, default: "", null: false
180
      t.string :homepage, limit: 60, default: ""
181
      t.boolean :is_public, default: true, null: false
182
      t.bigint :parent_id
183
      t.integer :projects_count, default: 0
184
      t.datetime :created_on
185
      t.datetime :updated_on
186 186
    end
187 187

  
188
    create_table "roles", :force => true do |t|
189
      t.column "name", :string, :limit => 30, :default => "", :null => false
188
    create_table :roles, force: true do |t|
189
      t.string :name, limit: 30, default: "", null: false
190 190
    end
191 191

  
192
    create_table "tokens", :force => true do |t|
193
      t.column "user_id", :integer, :default => 0, :null => false
194
      t.column "action", :string, :limit => 30, :default => "", :null => false
195
      t.column "value", :string, :limit => 40, :default => "", :null => false
196
      t.column "created_on", :datetime, :null => false
192
    create_table :tokens, force: true do |t|
193
      t.bigint :user_id, default: 0, null: false
194
      t.string :action, limit: 30, default: "", null: false
195
      t.string :value, limit: 40, default: "", null: false
196
      t.datetime :created_on, null: false
197 197
    end
198 198

  
199
    create_table "trackers", :force => true do |t|
200
      t.column "name", :string, :limit => 30, :default => "", :null => false
201
      t.column "is_in_chlog", :boolean, :default => false, :null => false
199
    create_table :trackers, force: true do |t|
200
      t.string :name, limit: 30, default: "", null: false
201
      t.boolean :is_in_chlog, default: false, null: false
202 202
    end
203 203

  
204
    create_table "users", :force => true do |t|
205
      t.column "login", :string, :limit => 30, :default => "", :null => false
206
      t.column "hashed_password", :string, :limit => 40, :default => "", :null => false
207
      t.column "firstname", :string, :limit => 30, :default => "", :null => false
208
      t.column "lastname", :string, :limit => 30, :default => "", :null => false
209
      t.column "mail", :string, :limit => 60, :default => "", :null => false
210
      t.column "mail_notification", :boolean, :default => true, :null => false
211
      t.column "admin", :boolean, :default => false, :null => false
212
      t.column "status", :integer, :default => 1, :null => false
213
      t.column "last_login_on", :datetime
214
      t.column "language", :string, :limit => 2, :default => ""
215
      t.column "auth_source_id", :integer
216
      t.column "created_on", :timestamp
217
      t.column "updated_on", :timestamp
204
    create_table :users, force: true do |t|
205
      t.string :login, limit: 30, default: "", null: false
206
      t.string :hashed_password, limit: 40, default: "", null: false
207
      t.string :firstname, limit: 30, default: "", null: false
208
      t.string :lastname, limit: 30, default: "", null: false
209
      t.string :mail, limit: 60, default: "", null: false
210
      t.boolean :mail_notification, default: true, null: false
211
      t.boolean :admin, default: false, null: false
212
      t.integer :status, default: 1, null: false
213
      t.datetime :last_login_on
214
      t.string :language, limit: 2, default: ""
215
      t.bigint :auth_source_id
216
      t.datetime :created_on
217
      t.datetime :updated_on
218 218
    end
219 219

  
220
    create_table "versions", :force => true do |t|
221
      t.column "project_id", :integer, :default => 0, :null => false
222
      t.column "name", :string, :limit => 30, :default => "", :null => false
223
      t.column "description", :string, :default => ""
224
      t.column "effective_date", :date
225
      t.column "created_on", :timestamp
226
      t.column "updated_on", :timestamp
220
    create_table :versions, force: true do |t|
221
      t.bigint :project_id, default: 0, null: false
222
      t.string :name, limit: 30, default: "", null: false
223
      t.string :description, default: ""
224
      t.date "effective_date"
225
      t.datetime :created_on
226
      t.datetime :updated_on
227 227
    end
228 228

  
229 229
    add_index "versions", ["project_id"], :name => "versions_project_id"
230 230

  
231
    create_table "workflows", :force => true do |t|
232
      t.column "tracker_id", :integer, :default => 0, :null => false
233
      t.column "old_status_id", :integer, :default => 0, :null => false
234
      t.column "new_status_id", :integer, :default => 0, :null => false
235
      t.column "role_id", :integer, :default => 0, :null => false
231
    create_table :workflows, force: true do |t|
232
      t.bigint :tracker_id, default: 0, null: false
233
      t.bigint :old_status_id, default: 0, null: false
234
      t.bigint :new_status_id, default: 0, null: false
235
      t.bigint :role_id, default: 0, null: false
236 236
    end
237 237

  
238 238
    # project
db/migrate/002_issue_move.rb (working copy)
1
class IssueMove < ActiveRecord::Migration[4.2]
1
class IssueMove < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/003_issue_add_note.rb (working copy)
1
class IssueAddNote < ActiveRecord::Migration[4.2]
1
class IssueAddNote < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/004_export_pdf.rb (working copy)
1
class ExportPdf < ActiveRecord::Migration[4.2]
1
class ExportPdf < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/005_issue_start_date.rb (working copy)
1
class IssueStartDate < ActiveRecord::Migration[4.2]
1
class IssueStartDate < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :issues, :start_date, :date
4
    add_column :issues, :done_ratio, :integer, :default => 0, :null => false
4
    add_column :issues, :done_ratio, :integer, default: 0, null: false
5 5
  end
6 6

  
7 7
  def self.down
db/migrate/006_calendar_and_activity.rb (working copy)
1
class CalendarAndActivity < ActiveRecord::Migration[4.2]
1
class CalendarAndActivity < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/007_create_journals.rb (working copy)
1
class CreateJournals < ActiveRecord::Migration[4.2]
1
class CreateJournals < ActiveRecord::Migration[5.2]
2 2

  
3 3
  # model removed, but needed for data migration
4 4
  class IssueHistory < ActiveRecord::Base; belongs_to :issue; end
......
6 6
  class Permission < ActiveRecord::Base; end
7 7

  
8 8
  def self.up
9
    create_table :journals, :force => true do |t|
10
      t.column "journalized_id", :integer, :default => 0, :null => false
11
      t.column "journalized_type", :string, :limit => 30, :default => "", :null => false
12
      t.column "user_id", :integer, :default => 0, :null => false
13
      t.column "notes", :text
14
      t.column "created_on", :datetime, :null => false
9
    create_table :journals, force: true do |t|
10
      t.bigint :journalized_id, default: 0, null: false
11
      t.string :journalized_type, limit: 30, default: "", null: false
12
      t.bigint :user_id, default: 0, null: false
13
      t.text :notes
14
      t.datetime :created_on, null: false
15 15
    end
16
    create_table :journal_details, :force => true do |t|
17
      t.column "journal_id", :integer, :default => 0, :null => false
18
      t.column "property", :string, :limit => 30, :default => "", :null => false
19
      t.column "prop_key", :string, :limit => 30, :default => "", :null => false
20
      t.column "old_value", :string
21
      t.column "value", :string
16
    create_table :journal_details, force: true do |t|
17
      t.bigint :journal_id, default: 0, null: false
18
      t.string :property, limit: 30, default: "", null: false
19
      t.string :prop_key, limit: 30, default: "", null: false
20
      t.string :old_value
21
      t.string :value
22 22
    end
23 23

  
24 24
    # indexes
......
41 41
    drop_table :journal_details
42 42
    drop_table :journals
43 43

  
44
    create_table "issue_histories", :force => true do |t|
45
      t.column "issue_id", :integer, :default => 0, :null => false
46
      t.column "status_id", :integer, :default => 0, :null => false
47
      t.column "author_id", :integer, :default => 0, :null => false
48
      t.column "notes", :text, :default => ""
49
      t.column "created_on", :timestamp
44
    create_table :issue_histories, force: true do |t|
45
      t.bigint :issue_id, default: 0, null: false
46
      t.bigint :status_id, default: 0, null: false
47
      t.bigint :author_id, default: 0, null: false
48
      t.text :notes, default: ""
49
      t.datetime :created_on
50 50
    end
51 51

  
52 52
    add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
db/migrate/008_create_user_preferences.rb (working copy)
1
class CreateUserPreferences < ActiveRecord::Migration[4.2]
1
class CreateUserPreferences < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :user_preferences do |t|
4
      t.column "user_id", :integer, :default => 0, :null => false
5
      t.column "others", :text
4
      t.bigint :user_id, default: 0, null: false
5
      t.text :others
6 6
    end
7 7
  end
8 8

  
db/migrate/009_add_hide_mail_pref.rb (working copy)
1
class AddHideMailPref < ActiveRecord::Migration[4.2]
1
class AddHideMailPref < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :user_preferences, :hide_mail, :boolean, :default => false
3
    add_column :user_preferences, :hide_mail, :boolean, default: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/010_create_comments.rb (working copy)
1
class CreateComments < ActiveRecord::Migration[4.2]
1
class CreateComments < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :comments do |t|
4
      t.column :commented_type, :string, :limit => 30, :default => "", :null => false
5
      t.column :commented_id, :integer, :default => 0, :null => false
6
      t.column :author_id, :integer, :default => 0, :null => false
7
      t.column :comments, :text
8
      t.column :created_on, :datetime, :null => false
9
      t.column :updated_on, :datetime, :null => false
4
      t.string :commented_type, limit: 30, default: "", null: false
5
      t.bigint :commented_id, default: 0, null: false
6
      t.bigint :author_id, default: 0, null: false
7
      t.text :comments
8
      t.datetime :created_on, null: false
9
      t.datetime :updated_on, null: false
10 10
    end
11 11
  end
12 12

  
db/migrate/011_add_news_comments_count.rb (working copy)
1
class AddNewsCommentsCount < ActiveRecord::Migration[4.2]
1
class AddNewsCommentsCount < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :news, :comments_count, :integer, :default => 0, :null => false
3
    add_column :news, :comments_count, :integer, default: 0, null: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/012_add_comments_permissions.rb (working copy)
1
class AddCommentsPermissions < ActiveRecord::Migration[4.2]
1
class AddCommentsPermissions < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/013_create_queries.rb (working copy)
1
class CreateQueries < ActiveRecord::Migration[4.2]
1
class CreateQueries < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    create_table :queries, :force => true do |t|
4
      t.column "project_id", :integer
5
      t.column "name", :string, :default => "", :null => false
6
      t.column "filters", :text
7
      t.column "user_id", :integer, :default => 0, :null => false
8
      t.column "is_public", :boolean, :default => false, :null => false
3
    create_table :queries, force: true do |t|
4
      t.bigint :project_id
5
      t.string :name, default: "", null: false
6
      t.text :filters
7
      t.bigint :user_id, default: 0, null: false
8
      t.boolean :is_public, default: false, null: false
9 9
    end
10 10
  end
11 11

  
db/migrate/014_add_queries_permissions.rb (working copy)
1
class AddQueriesPermissions < ActiveRecord::Migration[4.2]
1
class AddQueriesPermissions < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/015_create_repositories.rb (working copy)
1
class CreateRepositories < ActiveRecord::Migration[4.2]
1
class CreateRepositories < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    create_table :repositories, :force => true do |t|
4
      t.column "project_id", :integer, :default => 0, :null => false
5
      t.column "url", :string, :default => "", :null => false
3
    create_table :repositories, force: true do |t|
4
      t.bigint :project_id, default: 0, null: false
5
      t.string :url, default: "", null: false
6 6
    end
7 7
  end
8 8

  
db/migrate/016_add_repositories_permissions.rb (working copy)
1
class AddRepositoriesPermissions < ActiveRecord::Migration[4.2]
1
class AddRepositoriesPermissions < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/017_create_settings.rb (working copy)
1
class CreateSettings < ActiveRecord::Migration[4.2]
1
class CreateSettings < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    create_table :settings, :force => true do |t|
4
      t.column "name", :string, :limit => 30, :default => "", :null => false
5
      t.column "value", :text
3
    create_table :settings, force: true do |t|
4
      t.string :name, limit: 30, default: "", null: false
5
      t.text :value
6 6
    end
7 7
  end
8 8

  
db/migrate/018_set_doc_and_files_notifications.rb (working copy)
1
class SetDocAndFilesNotifications < ActiveRecord::Migration[4.2]
1
class SetDocAndFilesNotifications < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/019_add_issue_status_position.rb (working copy)
1
class AddIssueStatusPosition < ActiveRecord::Migration[4.2]
1
class AddIssueStatusPosition < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :issue_statuses, :position, :integer, :default => 1
3
    add_column :issue_statuses, :position, :integer, default: 1
4 4
    IssueStatus.all.each_with_index {|status, i| status.update_attribute(:position, i+1)}
5 5
  end
6 6

  
db/migrate/020_add_role_position.rb (working copy)
1
class AddRolePosition < ActiveRecord::Migration[4.2]
1
class AddRolePosition < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :roles, :position, :integer, :default => 1
3
    add_column :roles, :position, :integer, default: 1
4 4
    Role.all.each_with_index {|role, i| role.update_attribute(:position, i+1)}
5 5
  end
6 6

  
db/migrate/021_add_tracker_position.rb (working copy)
1
class AddTrackerPosition < ActiveRecord::Migration[4.2]
1
class AddTrackerPosition < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :trackers, :position, :integer, :default => 1
3
    add_column :trackers, :position, :integer, default: 1
4 4
    Tracker.all.each_with_index {|tracker, i| tracker.update_attribute(:position, i+1)}
5 5
  end
6 6

  
db/migrate/022_serialize_possibles_values.rb (working copy)
1
class SerializePossiblesValues < ActiveRecord::Migration[4.2]
1
class SerializePossiblesValues < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    CustomField.all.each do |field|
4 4
      if field.possible_values and field.possible_values.is_a? String
db/migrate/023_add_tracker_is_in_roadmap.rb (working copy)
1
class AddTrackerIsInRoadmap < ActiveRecord::Migration[4.2]
1
class AddTrackerIsInRoadmap < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :trackers, :is_in_roadmap, :boolean, :default => true, :null => false
3
    add_column :trackers, :is_in_roadmap, :boolean, default: true, null: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/024_add_roadmap_permission.rb (working copy)
1
class AddRoadmapPermission < ActiveRecord::Migration[4.2]
1
class AddRoadmapPermission < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/025_add_search_permission.rb (working copy)
1
class AddSearchPermission < ActiveRecord::Migration[4.2]
1
class AddSearchPermission < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/026_add_repository_login_and_password.rb (working copy)
1
class AddRepositoryLoginAndPassword < ActiveRecord::Migration[4.2]
1
class AddRepositoryLoginAndPassword < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :repositories, :login, :string, :limit => 60, :default => ""
4
    add_column :repositories, :password, :string, :limit => 60, :default => ""
3
    add_column :repositories, :login, :string, limit: 60, default: ""
4
    add_column :repositories, :password, :string, limit: 60, default: ""
5 5
  end
6 6

  
7 7
  def self.down
db/migrate/027_create_wikis.rb (working copy)
1
class CreateWikis < ActiveRecord::Migration[4.2]
1
class CreateWikis < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :wikis do |t|
4
      t.column :project_id, :integer, :null => false
5
      t.column :start_page, :string,  :limit => 255, :null => false
6
      t.column :status, :integer, :default => 1, :null => false
4
      t.bigint :project_id, null: false
5
      t.string :start_page,  limit: 255, null: false
6
      t.integer :status, default: 1, null: false
7 7
    end
8 8
    add_index :wikis, :project_id, :name => :wikis_project_id
9 9
  end
db/migrate/028_create_wiki_pages.rb (working copy)
1
class CreateWikiPages < ActiveRecord::Migration[4.2]
1
class CreateWikiPages < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :wiki_pages do |t|
4
      t.column :wiki_id, :integer, :null => false
5
      t.column :title, :string, :limit => 255, :null => false
6
      t.column :created_on, :datetime, :null => false
4
      t.bigint :wiki_id, null: false
5
      t.string :title, limit: 255, null: false
6
      t.datetime :created_on, null: false
7 7
    end
8 8
    add_index :wiki_pages, [:wiki_id, :title], :name => :wiki_pages_wiki_id_title
9 9
  end
db/migrate/029_create_wiki_contents.rb (working copy)
1
class CreateWikiContents < ActiveRecord::Migration[4.2]
1
class CreateWikiContents < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :wiki_contents do |t|
4
      t.column :page_id, :integer, :null => false
5
      t.column :author_id, :integer
6
      t.column :text, :text
7
      t.column :comments, :string, :limit => 255, :default => ""
8
      t.column :updated_on, :datetime, :null => false
9
      t.column :version, :integer, :null => false
4
      t.bigint :page_id, null: false
5
      t.bigint :author_id
6
      t.text :text
7
      t.string :comments, limit: 255, default: ""
8
      t.datetime :updated_on, null: false
9
      t.integer :version, null: false
10 10
    end
11 11
    add_index :wiki_contents, :page_id, :name => :wiki_contents_page_id
12 12

  
13 13
    create_table :wiki_content_versions do |t|
14
      t.column :wiki_content_id, :integer, :null => false
15
      t.column :page_id, :integer, :null => false
16
      t.column :author_id, :integer
17
      t.column :data, :binary
18
      t.column :compression, :string, :limit => 6, :default => ""
19
      t.column :comments, :string, :limit => 255, :default => ""
20
      t.column :updated_on, :datetime, :null => false
21
      t.column :version, :integer, :null => false
14
      t.bigint :wiki_content_id, null: false
15
      t.bigint :page_id, null: false
16
      t.bigint :author_id
17
      t.binary :data
18
      t.string :compression, limit: 6, default: ""
19
      t.string :comments, limit: 255, default: ""
20
      t.datetime :updated_on, null: false
21
      t.integer :version, null: false
22 22
    end
23 23
    add_index :wiki_content_versions, :wiki_content_id, :name => :wiki_content_versions_wcid
24 24
  end
db/migrate/030_add_projects_feeds_permissions.rb (working copy)
1
class AddProjectsFeedsPermissions < ActiveRecord::Migration[4.2]
1
class AddProjectsFeedsPermissions < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/031_add_repository_root_url.rb (working copy)
1
class AddRepositoryRootUrl < ActiveRecord::Migration[4.2]
1
class AddRepositoryRootUrl < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :repositories, :root_url, :string, :limit => 255, :default => ""
3
    add_column :repositories, :root_url, :string, limit: 255, default: ""
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/032_create_time_entries.rb (working copy)
1
class CreateTimeEntries < ActiveRecord::Migration[4.2]
1
class CreateTimeEntries < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :time_entries do |t|
4
      t.column :project_id,  :integer,  :null => false
5
      t.column :user_id,     :integer,  :null => false
6
      t.column :issue_id,    :integer
7
      t.column :hours,       :float,    :null => false
8
      t.column :comments,    :string,   :limit => 255
9
      t.column :activity_id, :integer,  :null => false
10
      t.column :spent_on,    :date,     :null => false
11
      t.column :tyear,       :integer,  :null => false
12
      t.column :tmonth,      :integer,  :null => false
13
      t.column :tweek,       :integer,  :null => false
14
      t.column :created_on,  :datetime, :null => false
15
      t.column :updated_on,  :datetime, :null => false
4
      t.bigint :project_id,   null: false
5
      t.bigint :user_id,      null: false
6
      t.bigint :issue_id   
7
      t.float :hours,          null: false
8
      t.string :comments,      limit: 255
9
      t.bigint :activity_id,  null: false
10
      t.date :spent_on,        null: false
11
      t.integer :tyear,        null: false
12
      t.integer :tmonth,       null: false
13
      t.integer :tweek,        null: false
14
      t.datetime :created_on,  null: false
15
      t.datetime :updated_on,  null: false
16 16
    end
17 17
    add_index :time_entries, [:project_id], :name => :time_entries_project_id
18 18
    add_index :time_entries, [:issue_id], :name => :time_entries_issue_id
db/migrate/033_add_timelog_permissions.rb (working copy)
1
class AddTimelogPermissions < ActiveRecord::Migration[4.2]
1
class AddTimelogPermissions < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/034_create_changesets.rb (working copy)
1
class CreateChangesets < ActiveRecord::Migration[4.2]
1
class CreateChangesets < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :changesets do |t|
4
      t.column :repository_id, :integer, :null => false
5
      t.column :revision, :integer, :null => false
6
      t.column :committer, :string, :limit => 30
7
      t.column :committed_on, :datetime, :null => false
8
      t.column :comments, :text
4
      t.bigint :repository_id, null: false
5
      t.integer :revision, null: false
6
      t.string :committer, limit: 30
7
      t.datetime :committed_on, null: false
8
      t.text :comments
9 9
    end
10 10
    add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev
11 11
  end
db/migrate/035_create_changes.rb (working copy)
1
class CreateChanges < ActiveRecord::Migration[4.2]
1
class CreateChanges < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :changes do |t|
4
      t.column :changeset_id, :integer, :null => false
5
      t.column :action, :string,  :limit => 1, :default => "", :null => false
6
      t.column :path, :string, :default => "", :null => false
7
      t.column :from_path, :string
8
      t.column :from_revision, :integer
4
      t.bigint :changeset_id, null: false
5
      t.string :action,  limit: 1, default: "", null: false
6
      t.string :path, default: "", null: false
7
      t.string :from_path
8
      t.integer :from_revision
9 9
    end
10 10
    add_index :changes, [:changeset_id], :name => :changesets_changeset_id
11 11
  end
db/migrate/036_add_changeset_commit_date.rb (working copy)
1
class AddChangesetCommitDate < ActiveRecord::Migration[4.2]
1
class AddChangesetCommitDate < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :changesets, :commit_date, :date
4 4
    Changeset.update_all "commit_date = committed_on"
db/migrate/037_add_project_identifier.rb (working copy)
1
class AddProjectIdentifier < ActiveRecord::Migration[4.2]
1
class AddProjectIdentifier < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :projects, :identifier, :string, :limit => 20
3
    add_column :projects, :identifier, :string, limit: 20
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/038_add_custom_field_is_filter.rb (working copy)
1
class AddCustomFieldIsFilter < ActiveRecord::Migration[4.2]
1
class AddCustomFieldIsFilter < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :custom_fields, :is_filter, :boolean, :null => false, :default => false
3
    add_column :custom_fields, :is_filter, :boolean, null: false, default: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/039_create_watchers.rb (working copy)
1
class CreateWatchers < ActiveRecord::Migration[4.2]
1
class CreateWatchers < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :watchers do |t|
4
      t.column :watchable_type, :string, :default => "", :null => false
5
      t.column :watchable_id, :integer, :default => 0, :null => false
6
      t.column :user_id, :integer
4
      t.string :watchable_type, default: "", null: false
5
      t.bigint :watchable_id, default: 0, null: false
6
      t.bigint :user_id
7 7
    end
8 8
  end
9 9

  
db/migrate/040_create_changesets_issues.rb (working copy)
1
class CreateChangesetsIssues < ActiveRecord::Migration[4.2]
1
class CreateChangesetsIssues < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :changesets_issues, :id => false do |t|
4
      t.column :changeset_id, :integer, :null => false
5
      t.column :issue_id, :integer, :null => false
4
      t.bigint :changeset_id, null: false
5
      t.bigint :issue_id, null: false
6 6
    end
7 7
    add_index :changesets_issues, [:changeset_id, :issue_id], :unique => true, :name => :changesets_issues_ids
8 8
  end
db/migrate/041_rename_comment_to_comments.rb (working copy)
1
class RenameCommentToComments < ActiveRecord::Migration[4.2]
1
class RenameCommentToComments < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns(Comment.table_name).detect{|c| c.name == "comment"}
4 4
    rename_column(:wiki_contents, :comment, :comments) if ActiveRecord::Base.connection.columns(WikiContent.table_name).detect{|c| c.name == "comment"}
db/migrate/042_create_issue_relations.rb (working copy)
1
class CreateIssueRelations < ActiveRecord::Migration[4.2]
1
class CreateIssueRelations < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :issue_relations do |t|
4
      t.column :issue_from_id, :integer, :null => false
5
      t.column :issue_to_id, :integer, :null => false
6
      t.column :relation_type, :string, :default => "", :null => false
7
      t.column :delay, :integer
4
      t.bigint :issue_from_id, null: false
5
      t.bigint :issue_to_id, null: false
6
      t.string :relation_type, default: "", null: false
7
      t.integer :delay
8 8
    end
9 9
  end
10 10

  
db/migrate/043_add_relations_permissions.rb (working copy)
1
class AddRelationsPermissions < ActiveRecord::Migration[4.2]
1
class AddRelationsPermissions < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/044_set_language_length_to_five.rb (working copy)
1
class SetLanguageLengthToFive < ActiveRecord::Migration[4.2]
1
class SetLanguageLengthToFive < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    change_column :users, :language, :string, :limit => 5, :default => ""
3
    change_column :users, :language, :string, limit: 5, default: ""
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/045_create_boards.rb (working copy)
1
class CreateBoards < ActiveRecord::Migration[4.2]
1
class CreateBoards < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :boards do |t|
4
      t.column :project_id, :integer, :null => false
5
      t.column :name, :string, :default => "", :null => false
6
      t.column :description, :string
7
      t.column :position, :integer, :default => 1
8
      t.column :topics_count, :integer, :default => 0, :null => false
9
      t.column :messages_count, :integer, :default => 0, :null => false
10
      t.column :last_message_id, :integer
4
      t.bigint :project_id, null: false
5
      t.string :name, default: "", null: false
6
      t.string :description
7
      t.integer :position, default: 1
8
      t.integer :topics_count, default: 0, null: false
9
      t.integer :messages_count, default: 0, null: false
10
      t.bigint :last_message_id
11 11
    end
12 12
    add_index :boards, [:project_id], :name => :boards_project_id
13 13
  end
db/migrate/046_create_messages.rb (working copy)
1
class CreateMessages < ActiveRecord::Migration[4.2]
1
class CreateMessages < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :messages do |t|
4
      t.column :board_id, :integer, :null => false
5
      t.column :parent_id, :integer
6
      t.column :subject, :string, :default => "", :null => false
7
      t.column :content, :text
8
      t.column :author_id, :integer
9
      t.column :replies_count, :integer, :default => 0, :null => false
10
      t.column :last_reply_id, :integer
11
      t.column :created_on, :datetime, :null => false
12
      t.column :updated_on, :datetime, :null => false
4
      t.bigint :board_id, null: false
5
      t.bigint :parent_id
6
      t.string :subject, default: "", null: false
7
      t.text :content
8
      t.bigint :author_id
9
      t.integer :replies_count, default: 0, null: false
10
      t.bigint :last_reply_id
11
      t.datetime :created_on, null: false
12
      t.datetime :updated_on, null: false
13 13
    end
14 14
    add_index :messages, [:board_id], :name => :messages_board_id
15 15
    add_index :messages, [:parent_id], :name => :messages_parent_id
db/migrate/047_add_boards_permissions.rb (working copy)
1
class AddBoardsPermissions < ActiveRecord::Migration[4.2]
1
class AddBoardsPermissions < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/048_allow_null_version_effective_date.rb (working copy)
1
class AllowNullVersionEffectiveDate < ActiveRecord::Migration[4.2]
1
class AllowNullVersionEffectiveDate < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    change_column :versions, :effective_date, :date, :default => nil, :null => true
3
    change_column :versions, :effective_date, :date, default: nil, null: true
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/049_add_wiki_destroy_page_permission.rb (working copy)
1
class AddWikiDestroyPagePermission < ActiveRecord::Migration[4.2]
1
class AddWikiDestroyPagePermission < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/050_add_wiki_attachments_permissions.rb (working copy)
1
class AddWikiAttachmentsPermissions < ActiveRecord::Migration[4.2]
1
class AddWikiAttachmentsPermissions < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/051_add_project_status.rb (working copy)
1
class AddProjectStatus < ActiveRecord::Migration[4.2]
1
class AddProjectStatus < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :projects, :status, :integer, :default => 1, :null => false
3
    add_column :projects, :status, :integer, default: 1, null: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/052_add_changes_revision.rb (working copy)
1
class AddChangesRevision < ActiveRecord::Migration[4.2]
1
class AddChangesRevision < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :changes, :revision, :string
4 4
  end
db/migrate/053_add_changes_branch.rb (working copy)
1
class AddChangesBranch < ActiveRecord::Migration[4.2]
1
class AddChangesBranch < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :changes, :branch, :string
4 4
  end
db/migrate/054_add_changesets_scmid.rb (working copy)
1
class AddChangesetsScmid < ActiveRecord::Migration[4.2]
1
class AddChangesetsScmid < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :changesets, :scmid, :string
4 4
  end
db/migrate/055_add_repositories_type.rb (working copy)
1
class AddRepositoriesType < ActiveRecord::Migration[4.2]
1
class AddRepositoriesType < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :repositories, :type, :string
4 4
    # Set class name for existing SVN repositories
db/migrate/056_add_repositories_changes_permission.rb (working copy)
1
class AddRepositoriesChangesPermission < ActiveRecord::Migration[4.2]
1
class AddRepositoriesChangesPermission < ActiveRecord::Migration[5.2]
2 2
  # model removed
3 3
  class Permission < ActiveRecord::Base; end
4 4

  
db/migrate/057_add_versions_wiki_page_title.rb (working copy)
1
class AddVersionsWikiPageTitle < ActiveRecord::Migration[4.2]
1
class AddVersionsWikiPageTitle < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :versions, :wiki_page_title, :string
4 4
  end
db/migrate/058_add_issue_categories_assigned_to_id.rb (working copy)
1
class AddIssueCategoriesAssignedToId < ActiveRecord::Migration[4.2]
1
class AddIssueCategoriesAssignedToId < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :issue_categories, :assigned_to_id, :integer
3
    add_column :issue_categories, :assigned_to_id, :bigint
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/059_add_roles_assignable.rb (working copy)
1
class AddRolesAssignable < ActiveRecord::Migration[4.2]
1
class AddRolesAssignable < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :roles, :assignable, :boolean, :default => true
3
    add_column :roles, :assignable, :boolean, default: true
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/060_change_changesets_committer_limit.rb (working copy)
1
class ChangeChangesetsCommitterLimit < ActiveRecord::Migration[4.2]
1
class ChangeChangesetsCommitterLimit < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    change_column :changesets, :committer, :string, :limit => nil
3
    change_column :changesets, :committer, :string, limit: nil
4 4
  end
5 5

  
6 6
  def self.down
7
    change_column :changesets, :committer, :string, :limit => 30
7
    change_column :changesets, :committer, :string, limit: 30
8 8
  end
9 9
end
db/migrate/061_add_roles_builtin.rb (working copy)
1
class AddRolesBuiltin < ActiveRecord::Migration[4.2]
1
class AddRolesBuiltin < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :roles, :builtin, :integer, :default => 0, :null => false
3
    add_column :roles, :builtin, :integer, default: 0, null: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/062_insert_builtin_roles.rb (working copy)
1
class InsertBuiltinRoles < ActiveRecord::Migration[4.2]
1
class InsertBuiltinRoles < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    Role.reset_column_information
4 4
    nonmember = Role.new(:name => 'Non member', :position => 0)
db/migrate/063_add_roles_permissions.rb (working copy)
1
class AddRolesPermissions < ActiveRecord::Migration[4.2]
1
class AddRolesPermissions < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :roles, :permissions, :text
4 4
  end
db/migrate/064_drop_permissions.rb (working copy)
1
class DropPermissions < ActiveRecord::Migration[4.2]
1
class DropPermissions < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    drop_table :permissions
4 4
    drop_table :permissions_roles
db/migrate/065_add_settings_updated_on.rb (working copy)
1
class AddSettingsUpdatedOn < ActiveRecord::Migration[4.2]
1
class AddSettingsUpdatedOn < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :settings, :updated_on, :timestamp
4 4
    # set updated_on
db/migrate/066_add_custom_value_customized_index.rb (working copy)
1
class AddCustomValueCustomizedIndex < ActiveRecord::Migration[4.2]
1
class AddCustomValueCustomizedIndex < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_index :custom_values, [:customized_type, :customized_id], :name => :custom_values_customized
4 4
  end
db/migrate/067_create_wiki_redirects.rb (working copy)
1
class CreateWikiRedirects < ActiveRecord::Migration[4.2]
1
class CreateWikiRedirects < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :wiki_redirects do |t|
4
      t.column :wiki_id, :integer, :null => false
5
      t.column :title, :string
6
      t.column :redirects_to, :string
7
      t.column :created_on, :datetime, :null => false
4
      t.bigint :wiki_id, null: false
5
      t.string :title
6
      t.string :redirects_to
7
      t.datetime :created_on, null: false
8 8
    end
9 9
    add_index :wiki_redirects, [:wiki_id, :title], :name => :wiki_redirects_wiki_id_title
10 10
  end
db/migrate/068_create_enabled_modules.rb (working copy)
1
class CreateEnabledModules < ActiveRecord::Migration[4.2]
1
class CreateEnabledModules < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    create_table :enabled_modules do |t|
4
      t.column :project_id, :integer
5
      t.column :name, :string, :null => false
4
      t.bigint :project_id
5
      t.string :name, null: false
6 6
    end
7 7
    add_index :enabled_modules, [:project_id], :name => :enabled_modules_project_id
8 8

  
db/migrate/069_add_issues_estimated_hours.rb (working copy)
1
class AddIssuesEstimatedHours < ActiveRecord::Migration[4.2]
1
class AddIssuesEstimatedHours < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :issues, :estimated_hours, :float
4 4
  end
db/migrate/070_change_attachments_content_type_limit.rb (working copy)
1
class ChangeAttachmentsContentTypeLimit < ActiveRecord::Migration[4.2]
1
class ChangeAttachmentsContentTypeLimit < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    change_column :attachments, :content_type, :string, :limit => nil
3
    change_column :attachments, :content_type, :string, limit: nil
4 4
  end
5 5

  
6 6
  def self.down
7
    change_column :attachments, :content_type, :string, :limit => 60
7
    change_column :attachments, :content_type, :string, limit: 60
8 8
  end
9 9
end
db/migrate/071_add_queries_column_names.rb (working copy)
1
class AddQueriesColumnNames < ActiveRecord::Migration[4.2]
1
class AddQueriesColumnNames < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    add_column :queries, :column_names, :text
4 4
  end
db/migrate/072_add_enumerations_position.rb (working copy)
1
class AddEnumerationsPosition < ActiveRecord::Migration[4.2]
1
class AddEnumerationsPosition < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position')
3
    add_column(:enumerations, :position, :integer, default: 1) unless Enumeration.column_names.include?('position')
4 4
    Enumeration.all.group_by(&:opt).each do |opt, enums|
5 5
      enums.each_with_index do |enum, i|
6 6
        # do not call model callbacks
db/migrate/073_add_enumerations_is_default.rb (working copy)
1
class AddEnumerationsIsDefault < ActiveRecord::Migration[4.2]
1
class AddEnumerationsIsDefault < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :enumerations, :is_default, :boolean, :default => false, :null => false
3
    add_column :enumerations, :is_default, :boolean, default: false, null: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/074_add_auth_sources_tls.rb (working copy)
1
class AddAuthSourcesTls < ActiveRecord::Migration[4.2]
1
class AddAuthSourcesTls < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :auth_sources, :tls, :boolean, :default => false, :null => false
3
    add_column :auth_sources, :tls, :boolean, default: false, null: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/075_add_members_mail_notification.rb (working copy)
1
class AddMembersMailNotification < ActiveRecord::Migration[4.2]
1
class AddMembersMailNotification < ActiveRecord::Migration[5.2]
2 2
  def self.up
3
    add_column :members, :mail_notification, :boolean, :default => false, :null => false
3
    add_column :members, :mail_notification, :boolean, default: false, null: false
4 4
  end
5 5

  
6 6
  def self.down
db/migrate/076_allow_null_position.rb (working copy)
1
class AllowNullPosition < ActiveRecord::Migration[4.2]
1
class AllowNullPosition < ActiveRecord::Migration[5.2]
2 2
  def self.up
3 3
    Enumeration.reset_column_information
4 4

  
5 5
    # removes the 'not null' constraint on position fields
6
    change_column :issue_statuses, :position, :integer, :default => 1, :null => true
7
    change_column :roles, :position, :integer, :default => 1, :null => true
8
    change_column :trackers, :position, :integer, :default => 1, :null => true
9
    change_column :boards, :position, :integer, :default => 1, :null => true
10
    change_column :enumerations, :position, :integer, :default => 1, :null => true
6
    change_column :issue_statuses, :position, :integer, default: 1, null: true
7
    change_column :roles, :position, :integer, default: 1, null: true
8
    change_column :trackers, :position, :integer, default: 1, null: true
9
    change_column :boards, :position, :integer, default: 1, null: true
10
    change_column :enumerations, :position, :integer, default: 1, null: true
11 11
  end
12 12

  
13 13
  def self.down
... This diff was truncated because it exceeds the maximum size that can be displayed.