class CreateEcomModelTaskTemplates < ActiveRecord::Migration[6.0] def change create_table :ecom_model_task_templates do |t| t.string :code, null: false t.string :name, null: false t.string :description t.references :task_template_type, index: { name: 'ttt_on_tt_indx' } t.string :ancestry, index: true t.timestamps end add_foreign_key :ecom_model_task_templates, :ecom_model_task_template_types, column: :task_template_type_id end end