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