-
- # change nullability from NULL to NOT NULL...
- # this one could be more complicated, need to set a DEFAULT value and update
- # the table first...
- if ( $self->null && ! $new->null ) {
-
- push @sql, "ALTER TABLE $table ALTER COLUMN $name SET NOT NULL";
-
+
+ # change nullability...
+
+ if ( $hashref->{'sql_alter_null'} ) {
+
+ push @sql, $hashref->{'sql_alter_null'};
+
+ } else {
+
+ # change nullability from NOT NULL to NULL
+ if ( ! $self->null && $new->null ) {
+
+ push @sql, "ALTER TABLE $table ALTER COLUMN $name DROP NOT NULL";
+
+ }
+
+ # change nullability from NULL to NOT NULL...
+ # this one could be more complicated, need to set a DEFAULT value and update
+ # the table first...
+ if ( $self->null && ! $new->null ) {
+
+ push @sql, "ALTER TABLE $table ALTER COLUMN $name SET NOT NULL";
+
+ }
+