diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-09-07 18:03:20 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-09-07 18:03:20 +0200 |
commit | 12ddc28f844fe63446a16ac908b09ed7b13c71ef (patch) | |
tree | 149ef1a7e2b32e6fa8c4462394daf942b7452440 /db/migrate | |
parent | 62a5cc7134457d21bf3a68bfdb04e090cf0e6ecf (diff) | |
parent | f2421b2b97d81ef7631f1baefb4ba4401c8a04dc (diff) | |
download | gitlab-ce-12ddc28f844fe63446a16ac908b09ed7b13c71ef.tar.gz |
Merge remote-tracking branch 'origin/master' into zj/gitlab-ce-zj-auto-devops-table
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170816234252_add_theme_id_to_users.rb | 10 | ||||
-rw-r--r-- | db/migrate/20170830130119_steal_remaining_event_migration_jobs.rb | 18 | ||||
-rw-r--r-- | db/migrate/20170830131015_swap_event_migration_tables.rb | 23 | ||||
-rw-r--r-- | db/migrate/limits_to_mysql.rb | 1 |
4 files changed, 51 insertions, 1 deletions
diff --git a/db/migrate/20170816234252_add_theme_id_to_users.rb b/db/migrate/20170816234252_add_theme_id_to_users.rb new file mode 100644 index 00000000000..5043f9ec591 --- /dev/null +++ b/db/migrate/20170816234252_add_theme_id_to_users.rb @@ -0,0 +1,10 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddThemeIdToUsers < ActiveRecord::Migration + DOWNTIME = false + + def change + add_column :users, :theme_id, :integer, limit: 2 + end +end diff --git a/db/migrate/20170830130119_steal_remaining_event_migration_jobs.rb b/db/migrate/20170830130119_steal_remaining_event_migration_jobs.rb new file mode 100644 index 00000000000..0dfdc4ed261 --- /dev/null +++ b/db/migrate/20170830130119_steal_remaining_event_migration_jobs.rb @@ -0,0 +1,18 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class StealRemainingEventMigrationJobs < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + disable_ddl_transaction! + + def up + Gitlab::BackgroundMigration.steal('MigrateEventsToPushEventPayloads') + end + + def down + end +end diff --git a/db/migrate/20170830131015_swap_event_migration_tables.rb b/db/migrate/20170830131015_swap_event_migration_tables.rb new file mode 100644 index 00000000000..5128d1b2fe7 --- /dev/null +++ b/db/migrate/20170830131015_swap_event_migration_tables.rb @@ -0,0 +1,23 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class SwapEventMigrationTables < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + def up + rename_tables + end + + def down + rename_tables + end + + def rename_tables + rename_table :events, :events_old + rename_table :events_for_migration, :events + rename_table :events_old, :events_for_migration + end +end diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb index be3501c4c2e..5cd9f3198e3 100644 --- a/db/migrate/limits_to_mysql.rb +++ b/db/migrate/limits_to_mysql.rb @@ -7,6 +7,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 - change_column :events, :data, :text, limit: 2147483647 end end |