class CreateCdxTaxons < ActiveRecord::Migration[5.1]
  def change
    create_table :cdx_taxons do |t|
      t.text :name, null: false
      t.text :description
      t.references :taxonomy, index: true, null: false
      t.references :parent, index: true
      t.integer :lft, null: false, index: true
      t.integer :rgt, null: false, index: true
      t.integer :depth, null: false, default: 0
      t.integer :children_count, null: false, default: 0
    end

    add_foreign_key :cdx_taxons, :cdx_taxonomies, column: :taxonomy_id
    add_foreign_key :cdx_taxons, :cdx_taxons, column: :parent_id
  end
end

class CreateCdxTaxons < ActiveRecord::Migration[5.1]
  def change
    create_table :cdx_taxons do |t|
      t.string :name, limit: 45, null: false
      t.text :description
      t.references :taxonomy, index: true, null: false
      t.references :parent, index: true
      t.integer :lft, null: false, index: true
      t.integer :rgt, null: false, index: true
      t.integer :depth, null: false, default: 0
      t.integer :children_count, null: false, default: 0
    end

    add_foreign_key :cdx_taxons, :cdx_taxonomies, column: :taxonomy_id
    add_foreign_key :cdx_taxons, :cdx_taxons, column: :parent_id
  end
end

Revert "Taxon name from string to text"
Revert "Taxon name from string to text"

This reverts commit 1575c3424acb2d177afd03acbf13ac1b1fc16fee.
