From 17e48b8980d89f0c5c3a00d4066c764093838e5a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Apr 2013 10:51:03 +0200 Subject: Explicitly specify NULL for nullable columns in generated schema --- odb/relational/schema.hxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'odb/relational/schema.hxx') diff --git a/odb/relational/schema.hxx b/odb/relational/schema.hxx index 69e8089..fcb176f 100644 --- a/odb/relational/schema.hxx +++ b/odb/relational/schema.hxx @@ -410,8 +410,10 @@ namespace relational virtual void null (sema_rel::column& c) { - if (!c.null ()) - os << " NOT NULL"; + // Specify both cases explicitly for better readability, + // especially in ALTER COLUMN clauses. + // + os << (c.null () ? " NULL" : " NOT NULL"); } virtual void -- cgit v1.1