class CreateDotations < ActiveRecord::Migration[5.2]
  def change
    create_table :dotations do |t|
      t.string :name
      t.string :formal_name
      t.date :date_from
      t.date :date_to
      t.bigint :min_amount
      t.integer :min_amount_curr_id, default: 1
      t.bigint :max_amount
      t.integer :max_amount_curr_id, default: 1
      t.integer :max_percent
      t.text :localization
      t.integer :partner_id
      t.integer :expert_id
      t.longtext :expert_info
      t.datetime :start_date
      t.datetime :end_date
      t.datetime :announcement_date
      t.longtext :full_descr
      t.longtext :positioning_text
      t.integer :points
      t.datetime :date_of_recruitment
      t.boolean :arch, default: false
      t.boolean :active, default: false
      t.integer :created_by
      t.integer :updated_by

      t.timestamps
    end
    add_index :dotations, :name
    add_index :dotations, :formal_name
    add_index :dotations, :arch
    add_index :dotations, :active
    add_index :dotations, :points
    add_index :dotations, :date_from
    add_index :dotations, :date_to
    add_index :dotations, :start_date
    add_index :dotations, :end_date
    add_index :dotations, :announcement_date
  end
end
