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
This diff is collapsed.
...@@ -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