Commit 9b327787 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix-migrations' into 'master'

Fix migrations for postgres on test environment

Make `be rake db:migrate:reset RAILS_ENV=test` work
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !2002
parents 7a4d4685 dd980b46
This diff is collapsed.
class CreateMergeRequestDiffs < ActiveRecord::Migration class CreateMergeRequestDiffs < ActiveRecord::Migration
def change def up
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
def down
drop_table :merge_request_diffs
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