Class: CreateAddresses

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/oxen_account/templates/address.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/oxen_account/templates/address.rb', line 2

def change
  create_table :addresses do |t|
    t.references :account, index: true
    t.string :building
    t.string :house_number
    t.string :street
    t.string :zipcode
    t.string :city
    t.string :country
    t.integer :lock_version

    t.timestamps null: false
  end
  add_foreign_key :addresses, :accounts
end