Skip to content

Instantly share code, notes, and snippets.

@klondaiker
Last active October 21, 2020 10:10
Show Gist options
  • Save klondaiker/f454f60ba2489e7ea2cdd262cb46793b to your computer and use it in GitHub Desktop.
Save klondaiker/f454f60ba2489e7ea2cdd262cb46793b to your computer and use it in GitHub Desktop.
class CreateDrawers < ActiveRecord::Migration[5.0]
def change
create_table :ecr_drawers do |t|
t.references :ecr_cashier, foreign_key: true, null: false
t.references :open_operator, foreign_key: true, null: false
t.references :close_operator, foreign_key: true, null: false
t.string :description
t.string :state, null: false, default: Ecr::Drawer::OPEN_STATE
t.monetize :open_current_balance, currency: { default: nil }
t.monetize :open_actual_balance, currency: { default: nil }
t.monetize :close_current_balance, currency: { default: nil }
t.monetize :close_actual_balance, currency: { default: nil }
t.monetize :sale_amount, currency: { default: nil }
t.monetize :refund_amount, currency: { default: nil }
t.datetime :opened_at, null: false
t.datetime :closed_at
t.timestamps
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment