Disable database triggers during import
This allows `updated_at` field values to be loaded during import.
Before this change, `updated_at` was set to when the import ran,
overwriting the values being loaded.
Also, the import completes in about one fifth the time
(on my slow MacBook Air).
+BEGIN;
+ -- Disable triggers on each table.
+{{~#each tables}}
+ ALTER TABLE "{{this.name}}" DISABLE TRIGGER ALL;
+{{~/each}}
+COMMIT;
+
BEGIN;
-- Set defaults for non-nullable columns not included in the dump.
{{~#each tables as |table|}}
@@ -23,3 +30,10 @@ BEGIN;
{{~/each}}
{{~/each}}
COMMIT;
+
+BEGIN;
+ -- Reenable triggers on each table.
+{{~#each tables}}
+ ALTER TABLE "{{this.name}}" ENABLE TRIGGER ALL;
+{{~/each}}
+COMMIT;
