summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-10-20 11:23:33 -0700
committerStan Hu <stanhu@gmail.com>2015-10-21 00:11:06 -0700
commite39fdc1ddd85857d96c0da2e420e66bc67bd7c8c (patch)
tree633a137a8e23ec013050180be68187723126c3f7 /db
parent6f5a844edce21cfad7bfa6d00f1424894ecf6a05 (diff)
downloadgitlab-ce-e39fdc1ddd85857d96c0da2e420e66bc67bd7c8c.tar.gz
Ensure MySQL CI limits DB migrations occur after the fields have been created
Closes https://github.com/gitlabhq/gitlabhq/issues/9753
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20151020173516_ci_limits_to_mysql.rb9
-rw-r--r--db/migrate/limits_to_mysql.rb4
2 files changed, 9 insertions, 4 deletions
diff --git a/db/migrate/20151020173516_ci_limits_to_mysql.rb b/db/migrate/20151020173516_ci_limits_to_mysql.rb
new file mode 100644
index 00000000000..9bb960082f5
--- /dev/null
+++ b/db/migrate/20151020173516_ci_limits_to_mysql.rb
@@ -0,0 +1,9 @@
+class CiLimitsToMysql < ActiveRecord::Migration
+ def change
+ return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
+
+ # CI
+ change_column :ci_builds, :trace, :text, limit: 1073741823
+ change_column :ci_commits, :push_data, :text, limit: 16777215
+ end
+end
diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb
index 73605d4c5e3..2b7afae6d7c 100644
--- a/db/migrate/limits_to_mysql.rb
+++ b/db/migrate/limits_to_mysql.rb
@@ -6,9 +6,5 @@ class LimitsToMysql < ActiveRecord::Migration
change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647
change_column :snippets, :content, :text, limit: 2147483647
change_column :notes, :st_diff, :text, limit: 2147483647
-
- # CI
- change_column :ci_builds, :trace, :text, limit: 1073741823
- change_column :ci_commits, :push_data, :text, limit: 16777215
end
end