File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -63,17 +63,13 @@ export default abstract class PostgresMigrations extends Migrations {
6363 const indexes = r . rows ;
6464
6565 text = `
66- SELECT
67- tc.constraint_name as "name"
68- FROM information_schema.table_constraints AS tc
69- JOIN information_schema.key_column_usage AS kcu
70- ON tc.constraint_name = kcu.constraint_name
71- AND tc.table_schema = kcu.table_schema
72- JOIN information_schema.constraint_column_usage AS ccu
73- ON ccu.constraint_name = tc.constraint_name
74- WHERE
75- tc.constraint_type <> 'FOREIGN KEY'
76- AND tc.table_schema = $1` ;
66+ SELECT con.conName as "name"
67+ FROM pg_catalog.pg_constraint con
68+ INNER JOIN pg_catalog.pg_class rel
69+ ON rel.oid = con.conRelId
70+ INNER JOIN pg_catalog.pg_namespace nsp
71+ ON nsp.oid = conNamespace
72+ WHERE nsp.nspName = $1` ;
7773
7874 r = await this . executeQuery ( { text, values } ) ;
7975 const constraints = r . rows ;
You can’t perform that action at this time.
0 commit comments