-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Add gin jsonb index to data column
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 GitHub Actions / lint
Check warning on line 2 in migrations/20240814124509_add_jsonb_data_index.js GitHub Actions / lint
|
||
* @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 GitHub Actions / lint
Check warning on line 12 in migrations/20240814124509_add_jsonb_data_index.js GitHub Actions / lint
|
||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return knex.schema.table("analytics_data_ga4", (table) => { | ||
table.dropIndex("analytics_data_gin_jsonb"); | ||
}); | ||
}; |