diff options
Diffstat (limited to 'db/post_migrate/20221114142616_drop_experiments_table.rb')
-rw-r--r-- | db/post_migrate/20221114142616_drop_experiments_table.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/db/post_migrate/20221114142616_drop_experiments_table.rb b/db/post_migrate/20221114142616_drop_experiments_table.rb new file mode 100644 index 00000000000..da6c1122494 --- /dev/null +++ b/db/post_migrate/20221114142616_drop_experiments_table.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class DropExperimentsTable < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + drop_table :experiments, if_exists: true + end + + def down + unless table_exists?(:experiments) + create_table :experiments do |t| # rubocop:disable Migration/SchemaAdditionMethodsNoPost + t.text :name, null: false + + t.index :name, unique: true + end + end + + add_text_limit :experiments, :name, 255 + end +end |