Sha256: 502d5334c5234677924aee54aeb700eef5d6e046b600d72eb3bc222dac1aa790

Contents?: true

Size: 1.67 KB

Versions: 3

Compression:

Stored size: 1.67 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.references :product_group,
                   null: true,
                   index: { name: 'wp_on_pg_indx' },
                   foreign_key: { to_table: :ecom_core_product_groups }
      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

3 entries across 3 versions & 1 rubygems

Version Path
ecom_core-1.2.34 db/migrate/20191202235434_create_ecom_core_work_products.rb
ecom_core-1.2.33 db/migrate/20191202235434_create_ecom_core_work_products.rb
ecom_core-1.2.32 db/migrate/20191202235434_create_ecom_core_work_products.rb