File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -680,7 +680,7 @@ class ManageSQLBuilder extends Builder {
680
680
} else if ( type === 'TINYINT' ) {
681
681
str += '(4)' ;
682
682
}
683
- if ( options . allowNull === false ) {
683
+ if ( options . allowNull === false || options . primaryKey === true ) {
684
684
str += ' NOT NULL' ;
685
685
}
686
686
if ( options . unsigned === true ) {
@@ -705,12 +705,12 @@ class ManageSQLBuilder extends Builder {
705
705
if ( options . onUpdate ) {
706
706
str += ` ON UPDATE ${ options . onUpdate } ` ;
707
707
}
708
- if ( is . string ( options . comment ) && is . empty ( options . comment ) === false ) {
709
- str += ` COMMENT '${ options . comment } '` ;
710
- }
711
708
if ( options . autoIncrement === true ) {
712
709
str += ' AUTO_INCREMENT' ;
713
710
}
711
+ if ( is . string ( options . comment ) && is . empty ( options . comment ) === false ) {
712
+ str += ` COMMENT '${ options . comment } '` ;
713
+ }
714
714
if ( options . after ) {
715
715
str += ' AFTER `' + options . after + '`' ;
716
716
}
You can’t perform that action at this time.
0 commit comments