Class: CreateClients

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/project/db/migrate/5_create_clients.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/project/db/migrate/5_create_clients.rb', line 2

def change
  create_table :clients do |t|
    t.belongs_to :city, null: true, index: true
    t.belongs_to :country, null: true, index: true

    t.string :name, null: true, limit: 64
    t.string :sex, index: true, limit: 6
    t.datetime :birthday, index: true

    t.timestamps
  end

  add_index :clients, :name, name: :clients_name, type: :fulltext

end