2021-08-24 11:10:36 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CreateTopics < ActiveRecord::Migration[6.1]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
2022-01-27 10:14:51 -05:00
|
|
|
def up
|
2021-08-24 11:10:36 -04:00
|
|
|
create_table_with_constraints :topics do |t|
|
|
|
|
t.text :name, null: false
|
|
|
|
t.text_limit :name, 255
|
|
|
|
|
|
|
|
t.index :name, unique: true
|
|
|
|
|
|
|
|
t.timestamps_with_timezone
|
|
|
|
end
|
|
|
|
end
|
2022-01-27 10:14:51 -05:00
|
|
|
|
|
|
|
def down
|
|
|
|
with_lock_retries do
|
|
|
|
drop_table :topics
|
|
|
|
end
|
|
|
|
end
|
2021-08-24 11:10:36 -04:00
|
|
|
end
|