# frozen_string_literal: true

class CreateUxToolkitTicketTemplates < ActiveRecord::Migration[6.1]
  def change
    create_table :ux_toolkit_ticket_templates do |t|
      t.string :name, null: false
      t.string :subject_template
      t.string :subject_template_mode, null: false, default: 'prefix'
      t.text :description_template
      t.boolean :enabled, null: false, default: true
      t.integer :position, null: false, default: 1
      t.timestamps
    end

    add_index :ux_toolkit_ticket_templates, :name
    add_index :ux_toolkit_ticket_templates, :enabled
    add_index :ux_toolkit_ticket_templates, :position
    add_index :ux_toolkit_ticket_templates, :subject_template_mode
  end
end
