Fixed issue when updating columns in Oracle (#11359)

* Fixed issue when updating columns in Oracle

* Fix lint error

* Removed optional chaining
This commit is contained in:
Aiden Foxx
2022-01-31 19:47:06 +01:00
committed by GitHub
parent fab37abb60
commit 4e0c27db73

View File

@@ -555,10 +555,14 @@ export class FieldsService {
}
}
if (field.schema?.is_nullable !== undefined && field.schema.is_nullable === false) {
column.notNullable();
} else {
column.nullable();
if (field.schema?.is_nullable === false) {
if (!alter || alter.is_nullable === true) {
column.notNullable();
}
} else if (field.schema?.is_nullable === true) {
if (!alter || alter.is_nullable === false) {
column.nullable();
}
}
if (field.schema?.is_primary_key) {