MorningPeak/db/migrate/20150616181122_create_bills.rb
Arthur Poulet fbf54dd98b update bill table
- due_date cannot be null
- emission_date cannot be null, default to today
- due_date is validated in the model
- update Schema.rb
2015-07-24 08:54:20 +02:00

17 lines
432 B
Ruby

class CreateBills < ActiveRecord::Migration
def change
create_table :bills do |t|
t.belongs_to :client, index: true, foreign_key: true
t.string :title, null: false
t.text :description
t.integer :amount
t.boolean :paid, default: false, null: false
t.date :emission_date, null: false, default: Date.today
t.date :due_date, null: false
t.timestamps null: false
end
end
end