From 9be2fbcb34dcd39dc4ea0a6c64ef6108d237073a Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Wed, 20 Nov 2024 15:35:12 +0000 Subject: [PATCH 1/5] MAP-1839 adding fake flyway_schema_history to allow db migration --- migrations/20241120000001_form_db.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 migrations/20241120000001_form_db.js diff --git a/migrations/20241120000001_form_db.js b/migrations/20241120000001_form_db.js new file mode 100644 index 00000000..c6f5c5ae --- /dev/null +++ b/migrations/20241120000001_form_db.js @@ -0,0 +1,8 @@ +exports.up = knex => + Promise.all([ + knex.schema.createTable('flyway_schema_history', table => { + table.increments('id').primary('pk_form') + table.string('version').nullable() + table.string('description').nullable() + }), + ]) From d7b9300bbc0f6d98df96761ca1a994e175360bbd Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Thu, 21 Nov 2024 08:59:42 +0000 Subject: [PATCH 2/5] MAP-1839 adding view to simulate flyway db for generic-service db refresh requirments --- migrations/20241120000001_form_db.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/migrations/20241120000001_form_db.js b/migrations/20241120000001_form_db.js index c6f5c5ae..968d8dc9 100644 --- a/migrations/20241120000001_form_db.js +++ b/migrations/20241120000001_form_db.js @@ -1,8 +1,3 @@ -exports.up = knex => - Promise.all([ - knex.schema.createTable('flyway_schema_history', table => { - table.increments('id').primary('pk_form') - table.string('version').nullable() - table.string('description').nullable() - }), - ]) +exports.up = async knex => { + await knex.raw(`CREATE VIEW flyway_schema_history AS SELECT name as view FROM knex_migrations ORDER BY id;`) +} From fcba255c92b87ee5fff5f3a2703185c317241004 Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Thu, 21 Nov 2024 09:04:01 +0000 Subject: [PATCH 3/5] MAP-1839 adding view to simulate flyway db for generic-service db refresh requirments --- migrations/20241120000001_form_db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/20241120000001_form_db.js b/migrations/20241120000001_form_db.js index 968d8dc9..d0955c63 100644 --- a/migrations/20241120000001_form_db.js +++ b/migrations/20241120000001_form_db.js @@ -1,3 +1,3 @@ exports.up = async knex => { - await knex.raw(`CREATE VIEW flyway_schema_history AS SELECT name as view FROM knex_migrations ORDER BY id;`) + await knex.raw(`CREATE VIEW flyway_schema_history AS SELECT name as version FROM knex_migrations ORDER BY id;`) } From b577e545630ffcb1781e073428b09041ee03460b Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Thu, 21 Nov 2024 10:31:09 +0000 Subject: [PATCH 4/5] MAP-1839 adding view to simulate flyway db for generic-service db refresh requirments --- migrations/20241120000001_form_db.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migrations/20241120000001_form_db.js b/migrations/20241120000001_form_db.js index d0955c63..64608afe 100644 --- a/migrations/20241120000001_form_db.js +++ b/migrations/20241120000001_form_db.js @@ -1,3 +1,6 @@ exports.up = async knex => { await knex.raw(`CREATE VIEW flyway_schema_history AS SELECT name as version FROM knex_migrations ORDER BY id;`) } +exports.down = async knex => { + await knex.raw(`drop VIEW flyway_schema_history`) +} \ No newline at end of file From ff7302b044d24c9f91645037337eee5b7c706233 Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Thu, 21 Nov 2024 10:40:19 +0000 Subject: [PATCH 5/5] MAP-1839 adding view to simulate flyway db for generic-service db refresh requirments --- migrations/20241120000001_form_db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/20241120000001_form_db.js b/migrations/20241120000001_form_db.js index 64608afe..b4d158d5 100644 --- a/migrations/20241120000001_form_db.js +++ b/migrations/20241120000001_form_db.js @@ -3,4 +3,4 @@ exports.up = async knex => { } exports.down = async knex => { await knex.raw(`drop VIEW flyway_schema_history`) -} \ No newline at end of file +}