File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed
adminforth/dataConnectors Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -75,23 +75,23 @@ class MysqlConnector extends AdminForthBaseConnector implements IAdminForthDataS
7575 }
7676
7777 private async hasPgCascadeFk ( tableName : string ) : Promise < void > {
78- const [ fkResults ] = await this . client . execute (
79- `
80- SELECT
81- TABLE_NAME AS child_table,
82- CONSTRAINT_NAME
83- FROM information_schema.REFERENTIAL_CONSTRAINTS
84- WHERE CONSTRAINT_SCHEMA = DATABASE()
85- AND REFERENCED_TABLE_NAME = ?
86- AND DELETE_RULE = 'CASCADE'
87- ` ,
88- [ tableName ]
89- ) ;
78+ const [ fkResults ] = await this . client . execute (
79+ `
80+ SELECT
81+ TABLE_NAME AS child_table,
82+ CONSTRAINT_NAME
83+ FROM information_schema.REFERENTIAL_CONSTRAINTS
84+ WHERE CONSTRAINT_SCHEMA = DATABASE()
85+ AND REFERENCED_TABLE_NAME = ?
86+ AND DELETE_RULE = 'CASCADE'
87+ ` ,
88+ [ tableName ]
89+ ) ;
9090
91- for ( const fk of fkResults as any [ ] ) {
92- afLogger . warn ( `The database has ON DELETE CASCADE, which may conflict with adminForth cascade deletion and upload logic. Please remove it.` ) ;
91+ for ( const fk of fkResults as any [ ] ) {
92+ afLogger . warn ( `The database has ON DELETE CASCADE, which may conflict with adminForth cascade deletion and upload logic. Please remove it.` ) ;
93+ }
9394 }
94- }
9595
9696 async discoverFields ( resource ) {
9797 const [ results ] = await this . client . execute ( "SHOW COLUMNS FROM " + resource . table ) ;
You can’t perform that action at this time.
0 commit comments