Skip to content

Commit 0e1a3dc

Browse files
committed
Drop crates.textsearchable_index_col from the export
This column is postgres specific and is normally populated via a trigger. The trigger is now enabled during the import so that the column can be dropped from the export.
1 parent 1e05289 commit 0e1a3dc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/tasks/dump_db/dump-db.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ description = "public"
8282
homepage = "public"
8383
documentation = "public"
8484
readme = "public"
85-
textsearchable_index_col = "public"
85+
textsearchable_index_col = "private" # This Postgres specific and can be derived from exported data
8686
repository = "public"
8787
max_upload_size = "public"
8888

src/tasks/dump_db/dump-import.sql.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ BEGIN;
1616
TRUNCATE "{{this.name}}" RESTART IDENTITY CASCADE;
1717
{{~/each}}
1818

19+
-- Enable this trigger so that `crates.textsearchable_index_col` can be excluded from the export
20+
ALTER TABLE crates ENABLE TRIGGER trigger_crates_tsvector_update;
21+
1922
-- Import the CSV data.
2023
{{~#each tables}}
2124
\copy "{{this.name}}" ({{this.columns}}) FROM 'data/{{this.name}}.csv' WITH CSV HEADER

0 commit comments

Comments
 (0)