debian-mirror-gitlab/db/migrate/20210729081351_create_topics.rb

23 lines
410 B
Ruby
Raw Normal View History

2021-11-11 11:23:49 +05:30
# frozen_string_literal: true
class CreateTopics < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
2022-04-04 11:22:00 +05:30
def up
2021-11-11 11:23:49 +05:30
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-04-04 11:22:00 +05:30
def down
with_lock_retries do
drop_table :topics
end
end
2021-11-11 11:23:49 +05:30
end