# frozen_string_literal: true

class CreateUxToolkitFavoriteProjects < ActiveRecord::Migration[6.1]
  def change
    create_table :ux_toolkit_favorite_projects do |t|
      t.integer :user_id, null: false
      t.integer :project_id, null: false
      t.timestamps
    end

    add_index :ux_toolkit_favorite_projects,
              [:user_id, :project_id],
              unique: true,
              name: 'index_ux_toolkit_favorite_projects_unique'
    add_index :ux_toolkit_favorite_projects,
              :user_id,
              name: 'index_ux_toolkit_favorite_projects_on_user_id'
    add_index :ux_toolkit_favorite_projects,
              :project_id,
              name: 'index_ux_toolkit_favorite_projects_on_project_id'
  end
end
