class CreateTagNames < ActiveRecord::Migration[7.0]
  def change
    create_table :tag_names do |t|
      t.string :name, limit: 255, null: false
      t.references :canonical, null: true, foreign_key: { to_table: :tag_names }, index: true
      t.timestamps
    end
    add_index :tag_names, :name, unique: true
  end
end
