aboutsummaryrefslogtreecommitdiff
path: root/db/migrate/20201008132251_create_taxonomies.rb
blob: 8c746b112bfa7bbb3f96c80c192fbeadd715ca0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class CreateTaxonomies < ActiveRecord::Migration[6.0]
  def change
    create_table :taxonomies do |t|
      t.string :name, limit: 64
      t.string :summary, limit: 64
      t.text :description
      t.uuid :uuid
      t.integer :categories_count, default: 0
      t.references :agent, null: false, foreign_key: true

      t.timestamps
    end
    add_index :taxonomies, :name, unique: true
    add_index :taxonomies, :uuid, unique: true
  end
end