drizzle-kit 0.9.43 → 0.9.46

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.
Files changed (2) hide show
  1. package/index.js +4 -25
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -164152,7 +164152,8 @@ function applyJsonDiff(json1, json2) {
164152
164152
  };
164153
164153
  }
164154
164154
  var findAlternationsInTable = (table) => {
164155
- const columns = table.columns;
164155
+ var _a;
164156
+ const columns = (_a = table.columns) != null ? _a : {};
164156
164157
  const added = Object.keys(columns).filter((it) => it.includes("__added")).map((it) => {
164157
164158
  return __spreadValues({}, columns[it]);
164158
164159
  });
@@ -164320,7 +164321,7 @@ var _prepareAddColumns = (tableName, columns) => {
164320
164321
  });
164321
164322
  };
164322
164323
  var _prepareAlterColumns = (tableName, columns) => {
164323
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
164324
+ var _a, _b, _c, _d, _e, _f, _g;
164324
164325
  let statements = [];
164325
164326
  for (const column of columns) {
164326
164327
  const columnName = typeof column.name !== "string" ? column.name.new : column.name;
@@ -164385,28 +164386,6 @@ var _prepareAlterColumns = (tableName, columns) => {
164385
164386
  columnName
164386
164387
  });
164387
164388
  }
164388
- if (((_h = column.notNull) == null ? void 0 : _h.type) === "added") {
164389
- statements.push({
164390
- type: "alter_table_alter_column_set_notnull",
164391
- tableName,
164392
- columnName
164393
- });
164394
- }
164395
- if (((_i = column.notNull) == null ? void 0 : _i.type) === "changed") {
164396
- const type2 = column.notNull.new ? "alter_table_alter_column_set_notnull" : "alter_table_alter_column_drop_notnull";
164397
- statements.push({
164398
- type: type2,
164399
- tableName,
164400
- columnName
164401
- });
164402
- }
164403
- if (((_j = column.notNull) == null ? void 0 : _j.type) === "deleted") {
164404
- statements.push({
164405
- type: "alter_table_alter_column_drop_notnull",
164406
- tableName,
164407
- columnName
164408
- });
164409
- }
164410
164389
  }
164411
164390
  return statements;
164412
164391
  };
@@ -164460,7 +164439,7 @@ var prepareAlterReferencesJson = (tableName, columns) => {
164460
164439
  };
164461
164440
  } else if (references.type === "changed") {
164462
164441
  const [oldFkey] = references.old.split(";");
164463
- const [fkName, toTable, toColumn, onDelete, onUpdate] = references.old.split(";");
164442
+ const [fkName, toTable, toColumn, onDelete, onUpdate] = references.new.split(";");
164464
164443
  const alterReference = {
164465
164444
  type: "alter_reference",
164466
164445
  fromTable: tableName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.9.43",
3
+ "version": "0.9.46",
4
4
  "author": "Alex Blokh <aleksandrblokh@gmail.com>",
5
5
  "license": "MIT",
6
6
  "bin": {