drizzle-kit 0.22.2 → 0.22.4

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.
package/bin.cjs CHANGED
@@ -26523,7 +26523,7 @@ var init_jsonDiffer = __esm({
26523
26523
  return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
26524
26524
  })
26525
26525
  );
26526
- const mappedAltered = altered.map((it) => alternationsInColumn(it));
26526
+ const mappedAltered = altered.map((it) => alternationsInColumn(it)).filter(Boolean);
26527
26527
  return {
26528
26528
  name: table4.name,
26529
26529
  schema: table4.schema || "",
@@ -26544,7 +26544,12 @@ var init_jsonDiffer = __esm({
26544
26544
  };
26545
26545
  alternationsInColumn = (column7) => {
26546
26546
  const altered = [column7];
26547
- const result = altered.map((it) => {
26547
+ const result = altered.filter((it) => {
26548
+ if ("type" in it && it.type.__old.replace(" (", "(") === it.type.__new.replace(" (", "(")) {
26549
+ return false;
26550
+ }
26551
+ return true;
26552
+ }).map((it) => {
26548
26553
  if (typeof it.name !== "string" && "__old" in it.name) {
26549
26554
  return {
26550
26555
  ...it,
@@ -26554,9 +26559,6 @@ var init_jsonDiffer = __esm({
26554
26559
  return it;
26555
26560
  }).map((it) => {
26556
26561
  if ("type" in it) {
26557
- if (it.type.__old.replace(" (", "(") === it.type.__new.replace(" (", "(")) {
26558
- return void 0;
26559
- }
26560
26562
  return {
26561
26563
  ...it,
26562
26564
  type: { type: "changed", old: it.type.__old, new: it.type.__new }
@@ -120408,64 +120410,6 @@ var init_pgPushUtils = __esm({
120408
120410
  tablesToTruncate.push(statement.tableName);
120409
120411
  shouldAskForApprove = true;
120410
120412
  }
120411
- } else if (statement.type === "alter_table_alter_column_drop_default") {
120412
- if (statement.columnNotNull) {
120413
- const res = await db2.query(
120414
- `select count(*) as count from ${tableNameWithSchemaFrom(
120415
- statement.schema,
120416
- statement.tableName,
120417
- renamedSchemas,
120418
- renamedTables
120419
- )}`
120420
- );
120421
- const count = Number(res[0].count);
120422
- if (count > 0) {
120423
- infoToPrint.push(
120424
- `\xB7 You're about to remove default value from ${source_default.underline(
120425
- statement.columnName
120426
- )} not-null column with ${count} items`
120427
- );
120428
- tablesToTruncate.push(statement.tableName);
120429
- statementsToExecute.push(
120430
- `truncate table ${tableNameWithSchemaFrom(
120431
- statement.schema,
120432
- statement.tableName,
120433
- renamedSchemas,
120434
- renamedTables
120435
- )} cascade;`
120436
- );
120437
- shouldAskForApprove = true;
120438
- }
120439
- }
120440
- } else if (statement.type === "alter_table_alter_column_set_notnull") {
120441
- if (typeof statement.columnDefault === "undefined") {
120442
- const res = await db2.query(
120443
- `select count(*) as count from ${tableNameWithSchemaFrom(
120444
- statement.schema,
120445
- statement.tableName,
120446
- renamedSchemas,
120447
- renamedTables
120448
- )}`
120449
- );
120450
- const count = Number(res[0].count);
120451
- if (count > 0) {
120452
- infoToPrint.push(
120453
- `\xB7 You're about to set not-null constraint to ${source_default.underline(
120454
- statement.columnName
120455
- )} column without default, which contains ${count} items`
120456
- );
120457
- tablesToTruncate.push(statement.tableName);
120458
- statementsToExecute.push(
120459
- `truncate table ${tableNameWithSchemaFrom(
120460
- statement.schema,
120461
- statement.tableName,
120462
- renamedSchemas,
120463
- renamedTables
120464
- )} cascade;`
120465
- );
120466
- shouldAskForApprove = true;
120467
- }
120468
- }
120469
120413
  } else if (statement.type === "alter_table_alter_column_drop_pk") {
120470
120414
  const res = await db2.query(
120471
120415
  `select count(*) as count from ${tableNameWithSchemaFrom(
@@ -122587,7 +122531,7 @@ var init_push = __esm({
122587
122531
  }
122588
122532
  }
122589
122533
  } catch (e2) {
122590
- console.log(e2);
122534
+ console.error(e2);
122591
122535
  }
122592
122536
  };
122593
122537
  sqlitePush = async (schemaPath, verbose, strict, credentials2, tablesFilter) => {
@@ -129558,7 +129502,7 @@ var printVersions = async () => {
129558
129502
  var versions = async () => {
129559
129503
  const { npmVersion } = await ormCoreVersions();
129560
129504
  const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
129561
- const envVersion = "0.22.2";
129505
+ const envVersion = "0.22.4";
129562
129506
  const kitVersion = envVersion ? `v${envVersion}` : "--";
129563
129507
  const versions2 = `drizzle-kit: ${kitVersion}
129564
129508
  ${ormVersion}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.22.2",
3
+ "version": "0.22.4",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "@arethetypeswrong/cli": "^0.15.3",
28
28
  "@aws-sdk/client-rds-data": "^3.556.0",
29
29
  "@cloudflare/workers-types": "^4.20230518.0",
30
- "@electric-sql/pglite": "^0.1.3",
30
+ "@electric-sql/pglite": "^0.1.5",
31
31
  "@hono/node-server": "^1.9.0",
32
32
  "@hono/zod-validator": "^0.2.1",
33
33
  "@libsql/client": "^0.4.2",
package/payload.js CHANGED
@@ -20657,7 +20657,7 @@ var init_jsonDiffer = __esm({
20657
20657
  return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
20658
20658
  })
20659
20659
  );
20660
- const mappedAltered = altered.map((it) => alternationsInColumn(it));
20660
+ const mappedAltered = altered.map((it) => alternationsInColumn(it)).filter(Boolean);
20661
20661
  return {
20662
20662
  name: table4.name,
20663
20663
  schema: table4.schema || "",
@@ -20678,7 +20678,12 @@ var init_jsonDiffer = __esm({
20678
20678
  };
20679
20679
  alternationsInColumn = (column4) => {
20680
20680
  const altered = [column4];
20681
- const result = altered.map((it) => {
20681
+ const result = altered.filter((it) => {
20682
+ if ("type" in it && it.type.__old.replace(" (", "(") === it.type.__new.replace(" (", "(")) {
20683
+ return false;
20684
+ }
20685
+ return true;
20686
+ }).map((it) => {
20682
20687
  if (typeof it.name !== "string" && "__old" in it.name) {
20683
20688
  return {
20684
20689
  ...it,
@@ -20688,9 +20693,6 @@ var init_jsonDiffer = __esm({
20688
20693
  return it;
20689
20694
  }).map((it) => {
20690
20695
  if ("type" in it) {
20691
- if (it.type.__old.replace(" (", "(") === it.type.__new.replace(" (", "(")) {
20692
- return void 0;
20693
- }
20694
20696
  return {
20695
20697
  ...it,
20696
20698
  type: { type: "changed", old: it.type.__old, new: it.type.__new }
@@ -33466,64 +33468,6 @@ var pgSuggestions = async (db, statements) => {
33466
33468
  tablesToTruncate.push(statement.tableName);
33467
33469
  shouldAskForApprove = true;
33468
33470
  }
33469
- } else if (statement.type === "alter_table_alter_column_drop_default") {
33470
- if (statement.columnNotNull) {
33471
- const res = await db.query(
33472
- `select count(*) as count from ${tableNameWithSchemaFrom(
33473
- statement.schema,
33474
- statement.tableName,
33475
- renamedSchemas,
33476
- renamedTables
33477
- )}`
33478
- );
33479
- const count2 = Number(res[0].count);
33480
- if (count2 > 0) {
33481
- infoToPrint.push(
33482
- `\xB7 You're about to remove default value from ${source_default.underline(
33483
- statement.columnName
33484
- )} not-null column with ${count2} items`
33485
- );
33486
- tablesToTruncate.push(statement.tableName);
33487
- statementsToExecute.push(
33488
- `truncate table ${tableNameWithSchemaFrom(
33489
- statement.schema,
33490
- statement.tableName,
33491
- renamedSchemas,
33492
- renamedTables
33493
- )} cascade;`
33494
- );
33495
- shouldAskForApprove = true;
33496
- }
33497
- }
33498
- } else if (statement.type === "alter_table_alter_column_set_notnull") {
33499
- if (typeof statement.columnDefault === "undefined") {
33500
- const res = await db.query(
33501
- `select count(*) as count from ${tableNameWithSchemaFrom(
33502
- statement.schema,
33503
- statement.tableName,
33504
- renamedSchemas,
33505
- renamedTables
33506
- )}`
33507
- );
33508
- const count2 = Number(res[0].count);
33509
- if (count2 > 0) {
33510
- infoToPrint.push(
33511
- `\xB7 You're about to set not-null constraint to ${source_default.underline(
33512
- statement.columnName
33513
- )} column without default, which contains ${count2} items`
33514
- );
33515
- tablesToTruncate.push(statement.tableName);
33516
- statementsToExecute.push(
33517
- `truncate table ${tableNameWithSchemaFrom(
33518
- statement.schema,
33519
- statement.tableName,
33520
- renamedSchemas,
33521
- renamedTables
33522
- )} cascade;`
33523
- );
33524
- shouldAskForApprove = true;
33525
- }
33526
- }
33527
33471
  } else if (statement.type === "alter_table_alter_column_drop_pk") {
33528
33472
  const res = await db.query(
33529
33473
  `select count(*) as count from ${tableNameWithSchemaFrom(
package/payload.mjs CHANGED
@@ -20663,7 +20663,7 @@ var init_jsonDiffer = __esm({
20663
20663
  return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
20664
20664
  })
20665
20665
  );
20666
- const mappedAltered = altered.map((it) => alternationsInColumn(it));
20666
+ const mappedAltered = altered.map((it) => alternationsInColumn(it)).filter(Boolean);
20667
20667
  return {
20668
20668
  name: table4.name,
20669
20669
  schema: table4.schema || "",
@@ -20684,7 +20684,12 @@ var init_jsonDiffer = __esm({
20684
20684
  };
20685
20685
  alternationsInColumn = (column4) => {
20686
20686
  const altered = [column4];
20687
- const result = altered.map((it) => {
20687
+ const result = altered.filter((it) => {
20688
+ if ("type" in it && it.type.__old.replace(" (", "(") === it.type.__new.replace(" (", "(")) {
20689
+ return false;
20690
+ }
20691
+ return true;
20692
+ }).map((it) => {
20688
20693
  if (typeof it.name !== "string" && "__old" in it.name) {
20689
20694
  return {
20690
20695
  ...it,
@@ -20694,9 +20699,6 @@ var init_jsonDiffer = __esm({
20694
20699
  return it;
20695
20700
  }).map((it) => {
20696
20701
  if ("type" in it) {
20697
- if (it.type.__old.replace(" (", "(") === it.type.__new.replace(" (", "(")) {
20698
- return void 0;
20699
- }
20700
20702
  return {
20701
20703
  ...it,
20702
20704
  type: { type: "changed", old: it.type.__old, new: it.type.__new }
@@ -33458,64 +33460,6 @@ var pgSuggestions = async (db, statements) => {
33458
33460
  tablesToTruncate.push(statement.tableName);
33459
33461
  shouldAskForApprove = true;
33460
33462
  }
33461
- } else if (statement.type === "alter_table_alter_column_drop_default") {
33462
- if (statement.columnNotNull) {
33463
- const res = await db.query(
33464
- `select count(*) as count from ${tableNameWithSchemaFrom(
33465
- statement.schema,
33466
- statement.tableName,
33467
- renamedSchemas,
33468
- renamedTables
33469
- )}`
33470
- );
33471
- const count2 = Number(res[0].count);
33472
- if (count2 > 0) {
33473
- infoToPrint.push(
33474
- `\xB7 You're about to remove default value from ${source_default.underline(
33475
- statement.columnName
33476
- )} not-null column with ${count2} items`
33477
- );
33478
- tablesToTruncate.push(statement.tableName);
33479
- statementsToExecute.push(
33480
- `truncate table ${tableNameWithSchemaFrom(
33481
- statement.schema,
33482
- statement.tableName,
33483
- renamedSchemas,
33484
- renamedTables
33485
- )} cascade;`
33486
- );
33487
- shouldAskForApprove = true;
33488
- }
33489
- }
33490
- } else if (statement.type === "alter_table_alter_column_set_notnull") {
33491
- if (typeof statement.columnDefault === "undefined") {
33492
- const res = await db.query(
33493
- `select count(*) as count from ${tableNameWithSchemaFrom(
33494
- statement.schema,
33495
- statement.tableName,
33496
- renamedSchemas,
33497
- renamedTables
33498
- )}`
33499
- );
33500
- const count2 = Number(res[0].count);
33501
- if (count2 > 0) {
33502
- infoToPrint.push(
33503
- `\xB7 You're about to set not-null constraint to ${source_default.underline(
33504
- statement.columnName
33505
- )} column without default, which contains ${count2} items`
33506
- );
33507
- tablesToTruncate.push(statement.tableName);
33508
- statementsToExecute.push(
33509
- `truncate table ${tableNameWithSchemaFrom(
33510
- statement.schema,
33511
- statement.tableName,
33512
- renamedSchemas,
33513
- renamedTables
33514
- )} cascade;`
33515
- );
33516
- shouldAskForApprove = true;
33517
- }
33518
- }
33519
33463
  } else if (statement.type === "alter_table_alter_column_drop_pk") {
33520
33464
  const res = await db.query(
33521
33465
  `select count(*) as count from ${tableNameWithSchemaFrom(