summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorZJ van de Weg <zegerjan@gitlab.com>2016-05-30 14:46:23 +0200
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-05-30 18:54:08 +0200
commitcbd7801b3d1d435a95ec70032c5acc9df33b0337 (patch)
tree7bd367bf31690e4a6b0115d238cf2c312c9fb2ab /db/migrate
parentf99b38c9d5dab11677b2680a671c1a66fb69283b (diff)
parent2485bd7bbf9686f993d2a417943feff5c7d5b6f3 (diff)
downloadgitlab-ce-cbd7801b3d1d435a95ec70032c5acc9df33b0337.tar.gz
Merge branch 'master' into awardables
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb2
-rw-r--r--db/migrate/20160525205328_remove_main_language_from_projects.rb21
-rw-r--r--db/migrate/20160528043124_add_users_state_index.rb9
3 files changed, 31 insertions, 1 deletions
diff --git a/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb b/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb
index 561c18a5776..6aed0fe03d2 100644
--- a/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb
+++ b/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb
@@ -28,7 +28,7 @@ class RemoveWrongImportUrlFromProjects < ActiveRecord::Migration
update_import_url(import_url, project)
update_import_data(import_url, project)
- rescue URI::InvalidURIError
+ rescue Addressable::URI::InvalidURIError
nullify_import_url(project)
end
end
diff --git a/db/migrate/20160525205328_remove_main_language_from_projects.rb b/db/migrate/20160525205328_remove_main_language_from_projects.rb
new file mode 100644
index 00000000000..0f9d60c385f
--- /dev/null
+++ b/db/migrate/20160525205328_remove_main_language_from_projects.rb
@@ -0,0 +1,21 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class RemoveMainLanguageFromProjects < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # When using the methods "add_concurrent_index" or "add_column_with_default"
+ # you must disable the use of transactions as these methods can not run in an
+ # existing transaction. When using "add_concurrent_index" make sure that this
+ # method is the _only_ method called in the migration, any other changes
+ # should go in a separate migration. This ensures that upon failure _only_ the
+ # index creation fails and can be retried or reverted easily.
+ #
+ # To disable transactions uncomment the following line and remove these
+ # comments:
+ # disable_ddl_transaction!
+
+ def change
+ remove_column :projects, :main_language
+ end
+end
diff --git a/db/migrate/20160528043124_add_users_state_index.rb b/db/migrate/20160528043124_add_users_state_index.rb
new file mode 100644
index 00000000000..e77a5460737
--- /dev/null
+++ b/db/migrate/20160528043124_add_users_state_index.rb
@@ -0,0 +1,9 @@
+class AddUsersStateIndex < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ disable_ddl_transaction!
+
+ def change
+ add_concurrent_index :users, :state
+ end
+end