Sha256: 5310d9c8cbd892b54feaddc3bc07cf01070e06f6e057b2b2b4291c065694f4c9

Contents?: true

Size: 957 Bytes

Versions: 5

Compression:

Stored size: 957 Bytes

Contents

class CreateEcomModelWorkComponentTemplates < ActiveRecord::Migration[6.0]
  def change
    create_table :ecom_model_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_model_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_model_work_component_templates, :ecom_model_work_product_templates,
                    column: :work_product_template_id
    add_foreign_key :ecom_model_work_component_templates, :ecom_model_task_templates,
                    column: :task_template_id
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ecom_model-2.0.4 db/migrate/20191201134420_create_ecom_model_work_component_templates.rb
ecom_model-2.0.3 db/migrate/20191201134420_create_ecom_model_work_component_templates.rb
ecom_model-2.0.2 db/migrate/20191201134420_create_ecom_model_work_component_templates.rb
ecom_model-2.0.1 db/migrate/20191201134420_create_ecom_model_work_component_templates.rb
ecom_model-2.0.0 db/migrate/20191201134420_create_ecom_model_work_component_templates.rb