# frozen_string_literal: true

class CreateUxToolkitFavoriteQueries < ActiveRecord::Migration[6.1]
  def change
    create_table :ux_toolkit_favorite_queries do |t|
      t.integer :user_id, null: false
      t.integer :query_id, null: false
      t.timestamps
    end

    add_index :ux_toolkit_favorite_queries,
              [:user_id, :query_id],
              unique: true,
              name: 'index_ux_toolkit_favorite_queries_on_user_and_query'
    add_index :ux_toolkit_favorite_queries, :user_id
    add_index :ux_toolkit_favorite_queries, :query_id
  end
end
