Sha256: 7c12a417b580228d883d95c2edc767ba953c41c1261302f217dfaefdecf26e35

Contents?: true

Size: 1.49 KB

Versions: 61

Compression:

Stored size: 1.49 KB

Contents

class CreateEcomCoreWorkComponents < ActiveRecord::Migration[6.0]
  def change
    create_table :ecom_core_work_components do |t|
      t.string :name, null: false
      t.json :dimension
      t.string :assignment_status, null: false, default: :unassigned
      t.string :task_status, null: false, default: :new
      t.integer :percent_completed, null: false, default: 0
      t.string :remark
      t.references :performer, index: { name: 'wc_on_performer_indx' }
      t.references :approver, index: { name: 'wc_on_approver_indx' }
      t.references :supervisor, index: { name: 'wc_on_supervisor_indx' }
      t.references :quality_controller, index: { name: 'wc_on_qc_indx' }
      t.date :start_date
      t.date :completion_date
      t.references :work_component_template, index: { name: 'wct_on_wc_indx' }
      t.references :work_product, index: { name: 'wp_on_wc_indx' }

      t.timestamps
    end

    add_foreign_key :ecom_core_work_components, :ecom_core_users, column: :performer_id
    add_foreign_key :ecom_core_work_components, :ecom_core_users, column: :approver_id
    add_foreign_key :ecom_core_work_components, :ecom_core_users, column: :supervisor_id
    add_foreign_key :ecom_core_work_components, :ecom_core_users, column: :quality_controller_id
    add_foreign_key :ecom_core_work_components, :ecom_core_work_component_templates,
                    column: :work_component_template_id
    add_foreign_key :ecom_core_work_components, :ecom_core_work_products, column: :work_product_id
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
ecom_core-1.2.5 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.2.4 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.2.3 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.2.2 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.2.1 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.2.0 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.28 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.27 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.26 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.25 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.24 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.23 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.22 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.21 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.20 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.19 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.18 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.17 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.16 db/migrate/20191206104247_create_ecom_core_work_components.rb
ecom_core-1.1.15 db/migrate/20191206104247_create_ecom_core_work_components.rb