Sha256: ac29704f2b7910f0a5acfe81b72c569dc54ac8871599a3a8cc4c65114190d943

Contents?: true

Size: 949 Bytes

Versions: 61

Compression:

Stored size: 949 Bytes

Contents

class CreateEcomCoreWorkComponentTemplates < ActiveRecord::Migration[6.0]
  def change
    create_table :ecom_core_work_component_templates do |t|
      t.string :code, null: false
      t.string :name, null: false
      t.string :description
      t.integer :relative_percentage
      t.json :dimension
      t.references :work_product_template, index: { name: 'wct_on_wpt_indx' }
      t.references :task_template, index: { name: 'wct_on_tt_indx' }

      t.timestamps
    end

    add_index :ecom_core_work_component_templates, %i[code work_product_template_id task_template_id],
              unique: true,
              name: 'wct_on_code_wpt_id_tt_id_indx'
    add_foreign_key :ecom_core_work_component_templates, :ecom_core_work_product_templates,
                    column: :work_product_template_id
    add_foreign_key :ecom_core_work_component_templates, :ecom_core_task_templates,
                    column: :task_template_id
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
ecom_core-1.0.0 db/migrate/20191201134420_create_ecom_core_work_component_templates.rb