Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/external-id-index'
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Feb 18, 2022
2 parents 20a9488 + ae15f64 commit 5529e56
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Ability to pass custom arguments (eg: SSL config) to server when running via Docker
- Allow bin/fetch start/end times to be fractional.
- Add an --exclude option to bin/fetch.
- Add an index on problem(external_id) to speed up bin/fetch --updates
- Open311 improvements:
- Increase default timeout.

Expand Down
1 change: 1 addition & 0 deletions bin/update-schema
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ else {
# (assuming schema change files are never half-applied, which should be the case)
sub get_db_version {
return 'EMPTY' if ! table_exists('problem');
return '0076' if index_exists('problem_external_id_idx');
return '0075' if column_exists('alert', 'parameter3');
return '0074' if index_exists('users_fulltext_idx');
return '0073' if index_exists('problem_fulltext_idx');
Expand Down
2 changes: 2 additions & 0 deletions db/downgrade_0076---0075.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DROP INDEX problem_external_id_idx;

1 change: 1 addition & 0 deletions db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ create table problem (
);
create index problem_state_latitude_longitude_idx on problem(state, latitude, longitude);
create index problem_user_id_idx on problem ( user_id );
create index problem_external_id_idx on problem(external_id);
create index problem_external_body_idx on problem(lower(external_body));
create index problem_radians_latitude_longitude_idx on problem(radians(latitude), radians(longitude));
create index problem_bodies_str_array_idx on problem USING gin(regexp_split_to_array(bodies_str, ','));
Expand Down
1 change: 1 addition & 0 deletions db/schema_0076-add-index-problem-external_id.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX CONCURRENTLY problem_external_id_idx on problem(external_id);

0 comments on commit 5529e56

Please sign in to comment.