Sha256: 1a831c7875b49476dec293d46ef776d22e5344e8f32d6d5f7ae564b1c0f10a93

Contents?: true

Size: 871 Bytes

Versions: 3

Compression:

Stored size: 871 Bytes

Contents

class CreateComeeCoreClientOrders < ActiveRecord::Migration[7.0]
  def change
    create_table :comee_core_client_orders do |t|
      t.string :order_number, null: false
      t.date :order_date, null: false, default: -> { "CURRENT_DATE" }
      t.date :delivery_date, null: false
      t.references :client,
        null: false,
        index: {name: "client_on_ccco_indx"},
        foreign_key: {to_table: :comee_core_clients}
      t.json :terms
      t.integer :status, null: false, default: 0
      t.string :delivery_address, null: false
      t.string :invoice_address, null: false
      t.string :remark
      t.float :total_price, null: true, default: 0
      t.float :amount_paid, null: true, default: 0
      t.float :amount_due, null: true, default: 0

      t.timestamps
    end
    add_index :comee_core_client_orders, :order_number, unique: true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
comee_core-0.1.12 db/migrate/20230812190652_create_comee_core_client_orders.rb
comee_core-0.1.11 db/migrate/20230812190652_create_comee_core_client_orders.rb
comee_core-0.1.10 db/migrate/20230812190652_create_comee_core_client_orders.rb