defmodule CodeCorps.Repo.Migrations.AddMissingIndexes do
  use Ecto.Migration

  def change do
    create index(:comments, [:github_comment_id])
    create index(:github_comments, [:github_issue_id])
    create index(:github_issues, [:github_repo_id])
    create index(:github_issues, [:github_pull_request_id])
    create index(:github_pull_requests, [:github_repo_id])
    create index(:organizations, [:owner_id])
    create index(:previews, [:user_id])
    create index(:project_categories, [:category_id])
    create index(:project_categories, [:project_id])
    create index(:project_github_repos, [:github_repo_id])
    create index(:project_github_repos, [:project_id])
    create index(:project_users, [:project_id])
    create index(:project_users, [:user_id])
    create index(:projects, [:organization_id])
    create index(:role_skills, [:role_id])
    create index(:role_skills, [:skill_id])
    create index(:slugged_routes, [:organization_id])
    create index(:slugged_routes, [:user_id])
    create index(:stripe_connect_cards, [:stripe_connect_account_id])
    create index(:stripe_connect_charges, [:stripe_connect_account_id])
    create index(:stripe_connect_charges, [:stripe_connect_customer_id])
    create index(:stripe_connect_charges, [:user_id])
    create index(:stripe_connect_customers, [:stripe_platform_customer_id])
    create index(:stripe_connect_customers, [:user_id])
    create index(:stripe_external_accounts, [:stripe_connect_account_id])
    create index(:stripe_file_upload, [:stripe_connect_account_id])
    create index(:stripe_invoices, [:stripe_connect_subscription_id])
    create index(:stripe_invoices, [:user_id])
    create index(:task_skills, [:task_id])
    create index(:task_skills, [:skill_id])
    create index(:tasks, [:github_issue_id])
    create index(:tasks, [:github_repo_id])
    create index(:tasks, [:task_list_id])
    create index(:user_categories, [:category_id])
    create index(:user_categories, [:user_id])
    create index(:user_roles, [:role_id])
    create index(:user_roles, [:user_id])
    create index(:user_skills, [:skill_id])
    create index(:user_skills, [:user_id])
    create index(:user_tasks, [:task_id])
    create index(:user_tasks, [:user_id])
  end
end
