fix: set null on delete

This commit is contained in:
chenos 2022-04-21 18:08:33 +08:00
parent f2a3cef3cf
commit 5dae47d5f1

View File

@ -59,6 +59,8 @@ export default class UsersPlugin extends Plugin<UserPluginConfig> {
dataIndex: 'state.currentUser.id', dataIndex: 'state.currentUser.id',
createOnly: true, createOnly: true,
visible: true, visible: true,
onDelete: 'SET NULL',
onUpdate: 'CASCADE',
}); });
collection.setField('createdBy', { collection.setField('createdBy', {
type: 'belongsTo', type: 'belongsTo',
@ -73,6 +75,8 @@ export default class UsersPlugin extends Plugin<UserPluginConfig> {
dataType: 'integer', dataType: 'integer',
dataIndex: 'state.currentUser.id', dataIndex: 'state.currentUser.id',
visible: true, visible: true,
onDelete: 'SET NULL',
onUpdate: 'CASCADE',
}); });
collection.setField('updatedBy', { collection.setField('updatedBy', {
type: 'belongsTo', type: 'belongsTo',