From 69cc7f252596f9948057c9d24931dfca10d31a21 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Fri, 22 Aug 2014 15:42:08 +0100 Subject: [PATCH] avoid logging creating table if the table is not actually created --- lib/mosql/schema.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mosql/schema.rb b/lib/mosql/schema.rb index b79c2f9..47a76df 100644 --- a/lib/mosql/schema.rb +++ b/lib/mosql/schema.rb @@ -79,7 +79,9 @@ def create_schema(db, clobber=false) meta = collection[:meta] composite_key = meta[:composite_key] keys = [] - log.info("Creating table '#{meta[:table]}'...") + if clobber + log.info("Creating table '#{meta[:table]}'...") + end db.send(clobber ? :create_table! : :create_table?, meta[:table]) do collection[:columns].each do |col| opts = {}