mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Default nullable to YES
This commit is contained in:
@@ -74,10 +74,13 @@ export default class CollectionsService {
|
||||
|
||||
const collectionInfo = omit(payload, 'fields');
|
||||
await collectionItemsService.create(collectionInfo);
|
||||
|
||||
const fieldPayloads = payload
|
||||
.fields!.filter((field) => field.system)
|
||||
.map((field) => field.system);
|
||||
|
||||
await fieldItemsService.create(fieldPayloads);
|
||||
|
||||
createdCollections.push(payload.collection);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -241,10 +241,10 @@ export default class FieldsService {
|
||||
column.defaultTo(field.database.default_value);
|
||||
}
|
||||
|
||||
if (field.database?.is_nullable && field.database.is_nullable === true) {
|
||||
column.nullable();
|
||||
} else {
|
||||
if (field.database.is_nullable !== undefined && field.database.is_nullable === false) {
|
||||
column.notNullable();
|
||||
} else {
|
||||
column.nullable();
|
||||
}
|
||||
|
||||
if (field.database?.is_primary_key) {
|
||||
|
||||
Reference in New Issue
Block a user