mysql change column to not null

This commit is contained in:
Jan Prochazka
2024-11-18 14:56:59 +01:00
parent 2ae98d0c2d
commit c0c9c7be20
6 changed files with 20 additions and 5 deletions

View File

@@ -263,7 +263,7 @@ export class SqlDumper implements AlterProcessor {
}
columnDefault(column: ColumnInfo) {
if (column.defaultConstraint != null) {
if (column.defaultConstraint != null && this.dialect?.namedDefaultConstraint) {
this.put(' ^constraint %i ^default %s ', column.defaultConstraint, column.defaultValue);
} else {
this.put(' ^default %s ', column.defaultValue);

View File

@@ -37,6 +37,7 @@ export interface SqlDialect {
renameSqlObject?: boolean;
multipleSchema?: boolean;
filteredIndexes?: boolean;
namedDefaultConstraint?: boolean;
specificNullabilityImplementation?: boolean;
omitForeignKeys?: boolean;