diff --git a/src/load.js b/src/load.js index e2eb78d..a929dae 100644 --- a/src/load.js +++ b/src/load.js @@ -12,7 +12,10 @@ async function load(options) { preventEnv('production', options.env) const env = getCommandEnv(options) - const command = `${getCommand(options, 'psql')} < ${structurePath}` + const command = `${getCommand( + options, + 'psql', + )} -v ON_ERROR_STOP=1 -f ${structurePath}` return exec(wrapDockerCommand(options, command), { env }) } diff --git a/src/utils.js b/src/utils.js index bba5dd6..a0b6212 100644 --- a/src/utils.js +++ b/src/utils.js @@ -5,7 +5,7 @@ export async function getInsertsFromMigrations(migrationsPath) { if (!(await exists(migrationsPath))) return [] const migrations = await glob('*.js', { cwd: migrationsPath }) return migrations.map( - migration => + (migration) => `INSERT INTO public.knex_migrations(name, batch, migration_time) VALUES ('${migration}', 1, NOW());`, ) }