Skip to content

Commit

Permalink
[Feature] Add gin jsonb index to data column
Browse files Browse the repository at this point in the history
  • Loading branch information
levinmr committed Aug 14, 2024
1 parent 046886e commit 9eeb436
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions migrations/20240814124509_add_jsonb_data_index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @param { import("knex").Knex } knex

Check warning on line 2 in migrations/20240814124509_add_jsonb_data_index.js

View workflow job for this annotation

GitHub Actions / lint

Missing JSDoc @param "knex" description

Check warning on line 2 in migrations/20240814124509_add_jsonb_data_index.js

View workflow job for this annotation

GitHub Actions / lint

Missing JSDoc @param "knex" description
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.raw(
"CREATE INDEX analytics_data_gin_jsonb ON analytics_data_ga4 USING gin(data jsonb_path_ops)",
);
};

/**
* @param { import("knex").Knex } knex

Check warning on line 12 in migrations/20240814124509_add_jsonb_data_index.js

View workflow job for this annotation

GitHub Actions / lint

Missing JSDoc @param "knex" description

Check warning on line 12 in migrations/20240814124509_add_jsonb_data_index.js

View workflow job for this annotation

GitHub Actions / lint

Missing JSDoc @param "knex" description
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.table("analytics_data_ga4", (table) => {
table.dropIndex("analytics_data_gin_jsonb");
});
};

0 comments on commit 9eeb436

Please sign in to comment.