drizzle-kit 0.20.17 → 0.20.18

Sign up to get free protection for your applications and to get access to all the features.
package/bin.cjs CHANGED
@@ -12162,11 +12162,23 @@ We have encountered a collision between the index name on columns ${source_defau
12162
12162
  }
12163
12163
  try {
12164
12164
  const fks = await db.query(
12165
- `SELECT INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME,information_schema.referential_constraints.UPDATE_RULE, information_schema.referential_constraints.DELETE_RULE
12166
- FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
12167
- LEFT JOIN information_schema.referential_constraints on information_schema.referential_constraints.constraint_name = information_schema.KEY_COLUMN_USAGE.CONSTRAINT_NAME
12168
- WHERE INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA = '${inputSchema}' AND INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME != 'PRIMARY' and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME is not null;
12169
- `
12165
+ `SELECT
12166
+ kcu.TABLE_SCHEMA,
12167
+ kcu.TABLE_NAME,
12168
+ kcu.CONSTRAINT_NAME,
12169
+ kcu.COLUMN_NAME,
12170
+ kcu.REFERENCED_TABLE_SCHEMA,
12171
+ kcu.REFERENCED_TABLE_NAME,
12172
+ kcu.REFERENCED_COLUMN_NAME,
12173
+ rc.UPDATE_RULE,
12174
+ rc.DELETE_RULE
12175
+ FROM
12176
+ INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu
12177
+ LEFT JOIN
12178
+ information_schema.referential_constraints rc
12179
+ ON kcu.CONSTRAINT_NAME = rc.CONSTRAINT_NAME
12180
+ WHERE kcu.TABLE_SCHEMA = '${inputSchema}' AND kcu.CONSTRAINT_NAME != 'PRIMARY'
12181
+ AND kcu.REFERENCED_TABLE_NAME IS NOT NULL;`
12170
12182
  );
12171
12183
  const fkRows = fks;
12172
12184
  for (const fkRow of fkRows) {
@@ -63890,7 +63902,7 @@ init_source();
63890
63902
  // package.json
63891
63903
  var package_default = {
63892
63904
  name: "drizzle-kit",
63893
- version: "0.20.17",
63905
+ version: "0.20.18",
63894
63906
  repository: "https://github.com/drizzle-team/drizzle-kit-mirror",
63895
63907
  author: "Drizzle Team",
63896
63908
  license: "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.20.17",
3
+ "version": "0.20.18",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
package/payload.js CHANGED
@@ -1729,11 +1729,23 @@ We have encountered a collision between the index name on columns ${source_defau
1729
1729
  }
1730
1730
  try {
1731
1731
  const fks = await db.query(
1732
- `SELECT INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME,information_schema.referential_constraints.UPDATE_RULE, information_schema.referential_constraints.DELETE_RULE
1733
- FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
1734
- LEFT JOIN information_schema.referential_constraints on information_schema.referential_constraints.constraint_name = information_schema.KEY_COLUMN_USAGE.CONSTRAINT_NAME
1735
- WHERE INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA = '${inputSchema}' AND INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME != 'PRIMARY' and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME is not null;
1736
- `
1732
+ `SELECT
1733
+ kcu.TABLE_SCHEMA,
1734
+ kcu.TABLE_NAME,
1735
+ kcu.CONSTRAINT_NAME,
1736
+ kcu.COLUMN_NAME,
1737
+ kcu.REFERENCED_TABLE_SCHEMA,
1738
+ kcu.REFERENCED_TABLE_NAME,
1739
+ kcu.REFERENCED_COLUMN_NAME,
1740
+ rc.UPDATE_RULE,
1741
+ rc.DELETE_RULE
1742
+ FROM
1743
+ INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu
1744
+ LEFT JOIN
1745
+ information_schema.referential_constraints rc
1746
+ ON kcu.CONSTRAINT_NAME = rc.CONSTRAINT_NAME
1747
+ WHERE kcu.TABLE_SCHEMA = '${inputSchema}' AND kcu.CONSTRAINT_NAME != 'PRIMARY'
1748
+ AND kcu.REFERENCED_TABLE_NAME IS NOT NULL;`
1737
1749
  );
1738
1750
  const fkRows = fks;
1739
1751
  for (const fkRow of fkRows) {
package/payload.mjs CHANGED
@@ -1739,11 +1739,23 @@ We have encountered a collision between the index name on columns ${source_defau
1739
1739
  }
1740
1740
  try {
1741
1741
  const fks = await db.query(
1742
- `SELECT INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME,information_schema.referential_constraints.UPDATE_RULE, information_schema.referential_constraints.DELETE_RULE
1743
- FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
1744
- LEFT JOIN information_schema.referential_constraints on information_schema.referential_constraints.constraint_name = information_schema.KEY_COLUMN_USAGE.CONSTRAINT_NAME
1745
- WHERE INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA = '${inputSchema}' AND INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME != 'PRIMARY' and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME is not null;
1746
- `
1742
+ `SELECT
1743
+ kcu.TABLE_SCHEMA,
1744
+ kcu.TABLE_NAME,
1745
+ kcu.CONSTRAINT_NAME,
1746
+ kcu.COLUMN_NAME,
1747
+ kcu.REFERENCED_TABLE_SCHEMA,
1748
+ kcu.REFERENCED_TABLE_NAME,
1749
+ kcu.REFERENCED_COLUMN_NAME,
1750
+ rc.UPDATE_RULE,
1751
+ rc.DELETE_RULE
1752
+ FROM
1753
+ INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu
1754
+ LEFT JOIN
1755
+ information_schema.referential_constraints rc
1756
+ ON kcu.CONSTRAINT_NAME = rc.CONSTRAINT_NAME
1757
+ WHERE kcu.TABLE_SCHEMA = '${inputSchema}' AND kcu.CONSTRAINT_NAME != 'PRIMARY'
1758
+ AND kcu.REFERENCED_TABLE_NAME IS NOT NULL;`
1747
1759
  );
1748
1760
  const fkRows = fks;
1749
1761
  for (const fkRow of fkRows) {