projects
/
dbsrgits/SQL-Translator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Avoid the posibility of having 'NOT NULL DEFAULT NULL' with primary keys in MySQL...
[dbsrgits/SQL-Translator.git]
/
lib
/
SQL
/
Translator
/
Producer
/
MySQL.pm
diff --git
a/lib/SQL/Translator/Producer/MySQL.pm
b/lib/SQL/Translator/Producer/MySQL.pm
index
bd53796
..
7fab1ac
100644
(file)
--- a/
lib/SQL/Translator/Producer/MySQL.pm
+++ b/
lib/SQL/Translator/Producer/MySQL.pm
@@
-612,7
+612,9
@@
sub create_field
}
# Null?
- $field_def .= ' NOT NULL' unless $field->is_nullable;
+ if (not ($field->is_nullable || $field->is_primary_key)) {
+ $field_def .= ' NOT NULL';
+ }
# Default?
SQL::Translator::Producer->_apply_default_value(