Sha256: 39363c7484613e8f3686917937e38cf74376474ec9376a8d65651b431294f99a

Contents?: true

Size: 1.88 KB

Versions: 1

Compression:

Stored size: 1.88 KB

Contents

class CreateEcomCoreWorkProducts < ActiveRecord::Migration[6.0]
  def change
    create_table :ecom_core_work_products do |t|
      t.string :name, null: false
      t.string :description
      t.string :design_reference_no, unique: true
      t.json :dimension
      t.references :product_group,
                   null: true,
                   index: { name: 'wp_on_pg_indx' },
                   foreign_key: { to_table: :ecom_core_product_groups }
      t.references :work_package,
                   null: true,
                   index: { name: 'wp_on_wp_indx' },
                   foreign_key: { to_table: :ecom_core_work_packages } 
      t.references :work_product_template,
                   null: false,
                   index: { name: 'wpt_on_wp_indx' },
                   foreign_key: { to_table: :ecom_core_work_product_templates }
      t.references :project,
                   null: false,
                   index: { name: 'projects_on_wp_indx' },
                   foreign_key: { to_table: :ecom_core_projects }
      t.string :status, default: 'New'
      t.integer :percent_completed, null: false, default: 0
      t.string :remark
      t.references :approver,
                   null: true,
                   index: false,
                   foreign_key: { to_table: :ecom_core_users }
      t.references :supervisor,
                   null: true,
                   index: false,
                   foreign_key: { to_table: :ecom_core_users }
      t.references :quality_controller,
                   null: true,
                   index: false,
                   foreign_key: { to_table: :ecom_core_users }
      t.datetime :start_date
      t.datetime :completion_date
      t.boolean :tasks_generated, null: false, default: false

      t.timestamps
    end

    add_index :ecom_core_work_products, %i[design_reference_no project_id], unique: true, name: 'wp_on_drpi_indx'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ecom_core-1.2.25 db/migrate/20191202235434_create_ecom_core_work_products.rb