fix: set null on delete
This commit is contained in:
		
							parent
							
								
									f2a3cef3cf
								
							
						
					
					
						commit
						5dae47d5f1
					
				@ -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',
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user