From 591d3bb4ddce96c3f7189846f1f6b63666b555d8 Mon Sep 17 00:00:00 2001 From: Epithumia Date: Wed, 18 Dec 2013 14:42:23 +0100 Subject: [PATCH] The fix for empty strings should only be applied to oracle sessions --- pokedex/db/load.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pokedex/db/load.py b/pokedex/db/load.py index 8471902..782c19e 100644 --- a/pokedex/db/load.py +++ b/pokedex/db/load.py @@ -268,7 +268,8 @@ def load(session, tables=[], directory=None, drop_tables=False, verbose=False, s for column_name, value in zip(column_names, csvs): column = table_obj.c[column_name] - if not column.nullable and value == '': + # Oracle treats empty strings as NULL + if not column.nullable and value == '' and oranames: value = ' ' if column.nullable and value == '': # Empty string in a nullable column really means NULL