Commit 5cc2315e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix migrations for postgres on test environment

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 24c7eafb
...@@ -66,8 +66,8 @@ class InitSchema < ActiveRecord::Migration ...@@ -66,8 +66,8 @@ class InitSchema < ActiveRecord::Migration
t.boolean "closed", default: false, null: false t.boolean "closed", default: false, null: false
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.text "st_commits", limit: 2147483647 t.text "st_commits"
t.text "st_diffs", limit: 2147483647 t.text "st_diffs"
t.boolean "merged", default: false, null: false t.boolean "merged", default: false, null: false
t.integer "state", default: 1, null: false t.integer "state", default: 1, null: false
t.integer "milestone_id" t.integer "milestone_id"
......
...@@ -2,11 +2,16 @@ class CreateMergeRequestDiffs < ActiveRecord::Migration ...@@ -2,11 +2,16 @@ class CreateMergeRequestDiffs < ActiveRecord::Migration
def change def change
create_table :merge_request_diffs do |t| create_table :merge_request_diffs do |t|
t.string :state, null: false, default: 'collected' t.string :state, null: false, default: 'collected'
t.text :st_commits, null: true, limit: 2147483647 t.text :st_commits, null: true
t.text :st_diffs, null: true, limit: 2147483647 t.text :st_diffs, null: true
t.integer :merge_request_id, null: false t.integer :merge_request_id, null: false
t.timestamps t.timestamps
end end
if ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647
change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647
end
end end
end end
class MigrateToNewShell < ActiveRecord::Migration class MigrateToNewShell < ActiveRecord::Migration
def change def change
return if Rails.env.test?
gitlab_shell_path = Gitlab.config.gitlab_shell.path gitlab_shell_path = Gitlab.config.gitlab_shell.path
if system("#{gitlab_shell_path}/bin/create-hooks") if system("#{gitlab_shell_path}/bin/create-hooks")
puts 'Repositories updated with new hooks' puts 'Repositories updated with new hooks'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment