From 8af5bdb2529a87a21602c70c4254b6f46fc1b795 Mon Sep 17 00:00:00 2001 From: david_wobrock Date: Thu, 22 Jun 2017 16:59:58 +0200 Subject: [PATCH] Not null constraint only applies when not in a Create Table statement --- migration_linter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration_linter.py b/migration_linter.py index 862d0c7..e25eeb4 100644 --- a/migration_linter.py +++ b/migration_linter.py @@ -26,7 +26,7 @@ class MigrationLinter: migration_tests = ( { - 'fn': lambda sql: re.search('NOT NULL', sql), + 'fn': lambda sql: re.search('NOT NULL', sql) and not re.search('CREATE TABLE', sql), 'err_msg': 'NOT NULL constraint on columns' }, { 'fn': lambda sql: re.search('DROP COLUMN', sql),