From 7b67b6be23e5d3602ffb24018fb4a54a3f21a59a Mon Sep 17 00:00:00 2001 From: Mike van Diepen Date: Fri, 13 Dec 2024 12:13:00 +0100 Subject: [PATCH] Add sequent:migrate:abort_if_pending_migrations To be used like db:abort_if_pending_migrations but for view_schema migrations --- lib/sequent/rake/migration_tasks.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/sequent/rake/migration_tasks.rb b/lib/sequent/rake/migration_tasks.rb index c7164a74..d8262535 100644 --- a/lib/sequent/rake/migration_tasks.rb +++ b/lib/sequent/rake/migration_tasks.rb @@ -125,6 +125,11 @@ def register_tasks! end end + desc 'Aborts if a migration is pending' + task abort_if_pending_migrations: [:create_and_migrate_sequent_view_schema] do + abort if Sequent.new_version != Sequent::Migrations::Versions.current_version + end + desc <<-EOS Shows the current status of the migrations EOS