export async function up(knex) {
  await knex.raw(`CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public`);
  await knex.raw(
    `create index posts_body_trgm_idx
      on posts
      using gist(body gist_trgm_ops);`
  );
  await knex.raw(
    `create index comments_body_trgm_idx
      on comments
      using gist(body gist_trgm_ops);`
  );
}

export async function down(knex) {
  await knex.raw(`drop index comments_body_trgm_idx;`);
  await knex.raw(`drop index posts_body_trgm_idx;`);
}

export async function up(knex) {
  await knex.raw(`create extension pg_trgm;`);
  await knex.raw(
    `create index posts_body_trgm_idx
      on posts
      using gist(body gist_trgm_ops);`
  );
  await knex.raw(
    `create index comments_body_trgm_idx
      on comments
      using gist(body gist_trgm_ops);`
  );
}

export async function down(knex) {
  await knex.raw(`drop index comments_body_trgm_idx;`);
  await knex.raw(`drop index posts_body_trgm_idx;`);
  await knex.raw(`drop extension pg_trgm;`);
}

Revert "allow for oob enabling of extension"
Revert "allow for oob enabling of extension"

246cef3528c9ac38de1e624d10565f9fb3f33d40
