From b73f063bc94b24ea563f82be8abdf2e2ea55b46b Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Mon, 22 Jun 2020 18:09:55 +0200 Subject: [PATCH] M #-: error message if db upgrade wasn't successful (#34) (cherry picked from commit 42c8c513e979778c3a8e71291a7d2481ba44d318) --- src/onedb/onedb.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/onedb/onedb.rb b/src/onedb/onedb.rb index 0d779da5d4..4b32e174ba 100644 --- a/src/onedb/onedb.rb +++ b/src/onedb/onedb.rb @@ -305,8 +305,22 @@ class OneDB puts puts "Total time: #{"%0.02f" % (timeb - timea).to_s}s" if ops[:verbose] - return 0 + db_version = @backend.read_db_version + local = db_version[:local_version] + shared = db_version[:version] + return 0 if local == OneDBBacKEnd::LATEST_DB_VERSION && + shared == OneDBBacKEnd::LATEST_DB_VERSION + + STDERR.puts 'ERROR: Database upgrade to the latest versions ' \ + "(local #{local}, shared #{shared})\nwasn't successful " \ + 'due to missing migration descriptors. Migrators ' \ + "are\nprovided as part of Enterprise Edition for " \ + "customers with active subscription.\nFor community " \ + 'with non-commercial deployments they are provided ' \ + "via a\ndedicated migration package, which must be " \ + 'obtained separately.' + 0 rescue Exception => e puts puts e.message