Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #3912 - Turbo87:handlebars, r=locks
Update `handlebars` crate to v4.1.3 see https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md ~It looks like none of the breaking changes in the v4 release are relevant to us.~ Update: I was wrong, sunng87/handlebars-rust#404 does affect us. I've added another commit which removes the now problematic handlebars whitespace control characters.
- Loading branch information
Showing
4 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
BEGIN ISOLATION LEVEL REPEATABLE READ, READ ONLY; | ||
{{~#each tables}} | ||
{{~#if this.filter}} | ||
{{#each tables}} | ||
{{#if this.filter}} | ||
\copy (SELECT {{this.columns}} FROM "{{this.name}}" WHERE {{this.filter}}) TO 'data/{{this.name}}.csv' WITH CSV HEADER | ||
{{~else}} | ||
{{else}} | ||
\copy "{{this.name}}" ({{this.columns}}) TO 'data/{{this.name}}.csv' WITH CSV HEADER | ||
{{~/if}} | ||
{{~/each}} | ||
{{/if}} | ||
{{/each}} | ||
COMMIT; |
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 |
---|---|---|
@@ -1,38 +1,38 @@ | ||
BEGIN; | ||
-- Disable triggers on each table. | ||
{{~#each tables}} | ||
{{#each tables}} | ||
ALTER TABLE "{{this.name}}" DISABLE TRIGGER ALL; | ||
{{~/each}} | ||
{{/each}} | ||
|
||
-- Set defaults for non-nullable columns not included in the dump. | ||
{{~#each tables as |table|}} | ||
{{~#each column_defaults}} | ||
{{#each tables as |table|}} | ||
{{#each column_defaults}} | ||
ALTER TABLE "{{table.name}}" ALTER COLUMN "{{@key}}" SET DEFAULT {{this}}; | ||
{{~/each}} | ||
{{~/each}} | ||
{{/each}} | ||
{{/each}} | ||
|
||
-- Truncate all tables. | ||
{{~#each tables}} | ||
{{#each tables}} | ||
TRUNCATE "{{this.name}}" RESTART IDENTITY CASCADE; | ||
{{~/each}} | ||
{{/each}} | ||
|
||
-- Enable this trigger so that `crates.textsearchable_index_col` can be excluded from the export | ||
ALTER TABLE "crates" ENABLE TRIGGER "trigger_crates_tsvector_update"; | ||
|
||
-- Import the CSV data. | ||
{{~#each tables}} | ||
{{#each tables}} | ||
\copy "{{this.name}}" ({{this.columns}}) FROM 'data/{{this.name}}.csv' WITH CSV HEADER | ||
{{~/each}} | ||
{{/each}} | ||
|
||
-- Drop the defaults again. | ||
{{~#each tables as |table|}} | ||
{{~#each column_defaults}} | ||
{{#each tables as |table|}} | ||
{{#each column_defaults}} | ||
ALTER TABLE "{{table.name}}" ALTER COLUMN "{{@key}}" DROP DEFAULT; | ||
{{~/each}} | ||
{{~/each}} | ||
{{/each}} | ||
{{/each}} | ||
|
||
-- Reenable triggers on each table. | ||
{{~#each tables}} | ||
{{#each tables}} | ||
ALTER TABLE "{{this.name}}" ENABLE TRIGGER ALL; | ||
{{~/each}} | ||
{{/each}} | ||
COMMIT; |