Class: CreateClientProfiles

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/db/create_client_profiles.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/db/create_client_profiles.rb', line 2

def change
  create_table :client_profiles do |t|
    t.string :first_name,         null: false
    t.string :last_name,          null: false
    t.string :phone
    t.string :email,              null: false
    t.string :address
    t.string :document,           null: false
    t.string :document_type,      null: false
    t.date   :birthday
    t.boolean :active,            null: false, default: true
    t.string :country,             null: false, default: "Argentina"
    t.string :city
    t.string :locality
    t.string :iva_category,       null: false, default: "Responsable Monotributo"

    t.timestamps
  end

  add_index :client_profiles, :email,                unique: true
  add_index :client_profiles, :document,                unique: true
end