Sha256: 1c790d260bf5b2165852853ca55e0c06a29b58237dc3dde0f87c8474224b4f5c

Contents?: true

Size: 1.97 KB

Versions: 1

Compression:

Stored size: 1.97 KB

Contents

class CreateEcomCoreJobCards < ActiveRecord::Migration[6.0]
  def change
    create_table :ecom_core_job_cards do |t|
      t.string :code, unique: true
      t.date :start_date
      t.date :due_date
      t.date :checkin_date
      t.date :checkout_date
      t.boolean :approved, null: false, default: false
      t.boolean :checkin_confirmed, null: false, default: false
      t.boolean :checkout_confirmed, null: false, default: false
      t.references :maintenance_service_order,
                   null: false,
                   index: { name: 'jc_on_mso_indx' },
                   foreign_key: { to_table: :ecom_core_maintenance_service_orders }
      t.references :service_provider,
                   null: false,
                   index: { name: 'jc_on_sp_indx' },
                   foreign_key: { to_table: :ecom_core_equipment_locations }
      t.references :checkout_by,
                   null: false,
                   index: { name: 'jc_on_cb_indx' },
                   foreign_key: { to_table: :ecom_core_users }
      t.references :checkout_to,
                   null: false,
                   index: { name: 'jc_on_ct_indx' },
                   foreign_key: { to_table: :ecom_core_equipment_locations }
      t.references :maintenance_status,
                   null: false,
                   index: { name: 'jc_on_ms_indx' },
                   foreign_key: { to_table: :ecom_core_lookups }
      t.references :checkin_by,
                   null: false,
                   index: { name: 'jc_on_cib_indx' },
                   foreign_key: { to_table: :ecom_core_users }
      t.references :checkin_to,
                   null: false,
                   index: { name: 'jc_on_cit_indx' },
                   foreign_key: { to_table: :ecom_core_equipment_locations }
      t.references :prepared_by,
                   null: false,
                   index: { name: 'jc_on_pb_indx' },
                   foreign_key: { to_table: :ecom_core_users }

      t.timestamps
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ecom_core-1.2.28 db/migrate/20200919085613_create_ecom_core_job_cards.rb