summaryrefslogtreecommitdiff
path: root/db/migrate/20170830131015_swap_event_migration_tables.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20170830131015_swap_event_migration_tables.rb')
-rw-r--r--db/migrate/20170830131015_swap_event_migration_tables.rb23
1 files changed, 23 insertions, 0 deletions
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