class CreateWorkflowSteps < ActiveRecord::Migration[6.1] def change create_table :workflow_steps do |t| t.bigint :custom_workflow_id, null: false t.string :name, null: false t.text :description t.integer :position, default: 0 t.integer :issue_status_id t.boolean :is_start, default: false t.boolean :is_end, default: false t.timestamps end add_index :workflow_steps, :custom_workflow_id add_index :workflow_steps, :position add_index :workflow_steps, :issue_status_id add_foreign_key :workflow_steps, :custom_workflows end end