From e30e6bfde9f9ef0ebc1c13f3d917674b1db89c99 Mon Sep 17 00:00:00 2001 From: Anugerah Erlaut Date: Tue, 12 Jul 2022 20:01:31 +0100 Subject: [PATCH] correct migration order --- .../20220704130411_add_delete_sample_file_trigger.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql/migrations/20220704130411_add_delete_sample_file_trigger.js b/src/sql/migrations/20220704130411_add_delete_sample_file_trigger.js index 6461b3099..842de774e 100644 --- a/src/sql/migrations/20220704130411_add_delete_sample_file_trigger.js +++ b/src/sql/migrations/20220704130411_add_delete_sample_file_trigger.js @@ -50,12 +50,12 @@ exports.up = async (knex) => { throw new Error('Environment variables AWS_REGION and AWS_ACCOUNT_ID are required'); } + await knex.raw(createDeleteSampleFileTriggerFunc(process.env.NODE_ENV)); + await knex.raw(` GRANT USAGE ON SCHEMA aws_lambda TO api_role; GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA aws_lambda TO api_role; `); - - await knex.raw(createDeleteSampleFileTriggerFunc(process.env.NODE_ENV)); }; exports.down = async (knex) => {