supatool 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -885,7 +885,9 @@ async function generateCreateTableDDL(client, tableName, schemaName = 'public')
885
885
  SELECT column_name
886
886
  FROM information_schema.table_constraints tc
887
887
  JOIN information_schema.key_column_usage kcu
888
- ON tc.constraint_name = kcu.constraint_name
888
+ ON tc.constraint_catalog = kcu.constraint_catalog
889
+ AND tc.constraint_schema = kcu.constraint_schema
890
+ AND tc.constraint_name = kcu.constraint_name
889
891
  WHERE tc.table_schema = $1
890
892
  AND tc.table_name = $2
891
893
  AND tc.constraint_type = 'PRIMARY KEY'
@@ -919,7 +921,9 @@ async function generateCreateTableDDL(client, tableName, schemaName = 'public')
919
921
  string_agg(kcu.column_name, ', ' ORDER BY kcu.ordinal_position) as columns
920
922
  FROM information_schema.table_constraints tc
921
923
  JOIN information_schema.key_column_usage kcu
922
- ON tc.constraint_name = kcu.constraint_name
924
+ ON tc.constraint_catalog = kcu.constraint_catalog
925
+ AND tc.constraint_schema = kcu.constraint_schema
926
+ AND tc.constraint_name = kcu.constraint_name
923
927
  WHERE tc.table_schema = $1
924
928
  AND tc.table_name = $2
925
929
  AND tc.constraint_type = 'UNIQUE'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supatool",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "CLI for PostgreSQL (Cloud SQL / Supabase): extract schema to files, deploy schema diffs, apply migrations, seed export.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "scripts": {
11
11
  "build": "tsc",
12
- "test": "npm run build && node test/smoke.js",
12
+ "test": "npm run build && node test/smoke.js && node test/definition-extractor.js",
13
13
  "start": "tsx src/bin/supatool.ts",
14
14
  "local": "tsx src/bin/supatool.ts"
15
15
  },