class CreateWbaSubmissions < ActiveRecord::Migration
  def change
    create_table :wba_submissions do |t|
      t.belongs_to :workflow_instance, index: true
      t.string :state
      t.string :sti_type
      t.text :notes

      t.boolean :all_clear, default: false, null: false
      t.string :new_service_group

      t.timestamps null: false
    end

    WorkflowInstance::Scenario2.pluck(:id).each{|id| WbaSubmission::Scenario2.create!(workflow_instance_id: id) }
  end
end
