diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-28 18:07:10 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-28 18:07:10 +0200 |
commit | 431dc780d53e224fef9953d378a817a6865a4bbf (patch) | |
tree | 542896d8ca7edbef2c57184c321621631664a25c /db | |
parent | 98d9a9fdaf1a580bece56230e2ff9a86d8642923 (diff) | |
download | gitlab-ci-431dc780d53e224fef9953d378a817a6865a4bbf.tar.gz |
Fix migrations and add mysql limits
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20130114153451_change_schedule_invertal.rb | 4 | ||||
-rw-r--r-- | db/migrate/limits_to_mysql.rb | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/db/migrate/20130114153451_change_schedule_invertal.rb b/db/migrate/20130114153451_change_schedule_invertal.rb index ef6ece8..accf3ee 100644 --- a/db/migrate/20130114153451_change_schedule_invertal.rb +++ b/db/migrate/20130114153451_change_schedule_invertal.rb @@ -1,6 +1,6 @@ class ChangeScheduleInvertal < ActiveRecord::Migration def up - if ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) + if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL' connection.execute(%q{ ALTER TABLE projects ALTER COLUMN polling_interval @@ -12,7 +12,7 @@ class ChangeScheduleInvertal < ActiveRecord::Migration end def down - if ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) + if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL' connection.execute(%q{ ALTER TABLE projects ALTER COLUMN polling_interval diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb new file mode 100644 index 0000000..faf8011 --- /dev/null +++ b/db/migrate/limits_to_mysql.rb @@ -0,0 +1,8 @@ +class LimitsToMysql < ActiveRecord::Migration + def up + return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/ + + change_column :builds, :trace, :text, limit: 1073741823 + change_column :builds, :push_data, :text, limit: 16777215 + end +end |