Previously, the stored procedure to_tsv_parent_directories did not
account for stdlib packages. This led to incorrect tsvector strings
for those packages. This CL fixes that bug and repopulates
packages.tsv_parent_directories and search_documents.tsv_parent_directories.
Additionally the following functions were previously left out of the
do wn migration for 000001, and are now added:
* trigger_modify_packages_tsv_parent_directories
* trigger_modify_search_documents_tsv_parent_directories
Updates b/142392929
Change-Id: Ib6f393695715a4f743060029413c9c5e44612cc1
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/581195
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The files in migrations are flatten into a single file using the
command:
```
pg_dump -p 5432 discovery-database -s >
migrations/000001_initial_schema.up.sql
```
The dump file is edited for readability and the following changes:
* Collations were removed because the now database has the settings
LC_COLLATE = C and LC_CTYPE = C
* Columns set to NOT NULL:
+ versions.series_path
+ versions.prerelease
+ packages.goos
+ packages.goarch
+ packages.commit_time
+ search_documents.name
* Columns that are now nullable:
+ versions.readme_file_path
+ versions.readme_contents
* Columns dropped
+ versions.build
+ packages.suffix
* Columns added
+ packages.updated_at (populated with trigger_modify_updated_at)
* versions.version_type now uses the version_type enum
* search_documents_tsv_search_tokens_idx is renamed to idx_search_documents_tsv_search_tokens
Updates b/142559211
Change-Id: I6dfb6d64b9dd82696f2b0a3752799c417e4f34bc
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/576649
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>