drizzle-kit 0.16.9-60b8a7b → 0.16.9-7522b5d

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 (3) hide show
  1. package/index.js +3793 -688
  2. package/package.json +13 -7
  3. package/utils.js +125 -82
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.16.9-60b8a7b",
3
+ "version": "0.16.9-7522b5d",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -8,11 +8,15 @@
8
8
  "drizzle-kit": "./index.js"
9
9
  },
10
10
  "scripts": {
11
- "start:pg": "node -r esbuild-register ./src/cli/index.ts generate --out ./dev/migrations --dialect pg --schema ./dev/data",
12
- "start:mysql": "node -r esbuild-register ./src/cli/index.ts generate:mysql --out ./dev/migrations --schema ./dev/migrations/schema.ts",
11
+ "migrate:old": "drizzle-kit generate:pg --out ./dev/migrations-pg --schema ./dev/migrations-pg/schema.ts",
12
+ "migrate:old:mysql": "drizzle-kit generate:mysql --out ./dev/migrations-mysql --schema ./dev/migrations-mysql/schema.ts",
13
+ "start:pg": "node -r esbuild-register ./src/cli/index.ts generate:pg --out ./dev/migrations-pg --schema ./dev/migrations-pg/schema.ts",
14
+ "start:mysql": "node -r esbuild-register ./src/cli/index.ts generate:mysql --out ./dev/migrations-mysql --schema ./dev/migrations-mysql/schema.ts",
13
15
  "check:pg": "node -r esbuild-register ./src/cli/index.ts check --out ./dev/migrations --dialect pg",
14
- "introspect:mysql": "node -r esbuild-register ./src/cli/index.ts introspect:mysql --out ./dev/migrations --connectionString mysql://eteb3igve6392dte6e47:pscale_pw_GyFkQr8pIWTuPTU9iJ7ajE7HfBxLQZ7kwJJ67PlOhbr@eu-central.connect.psdb.cloud/test?ssl={\\\"rejectUnauthorized\\\":true}",
15
- "up:pg": "node -r esbuild-register ./src/cli/index.ts up --out ./dev/equedi --dialect pg",
16
+ "introspect:mysql": "node -r esbuild-register ./src/cli/index.ts introspect:mysql --out ./dev/migrations-mysql --connectionString",
17
+ "introspect:pg": "node -r esbuild-register ./src/cli/index.ts introspect:pg --out ./dev/migrations-pg --connectionString=postgresql://postgres@localhost:5432/introspect",
18
+ "up:pg": "node -r esbuild-register ./src/cli/index.ts up:pg --out ./dev/migrations-pg",
19
+ "up:mysql": "node -r esbuild-register ./src/cli/index.ts up:mysql --out ./dev/migrations-mysql",
16
20
  "check:equedi": "node -r esbuild-register ./src/cli/index.ts check --out ./dev/equedi --dialect pg",
17
21
  "run": "node -r esbuild-register index.ts",
18
22
  "watch": "esbuild ./src/clie/index.ts --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild --external:pg-native --sourcemap --watch",
@@ -22,7 +26,7 @@
22
26
  "prepare-snapshot": "node -r esbuild-register ./dev/prepare-snapshot prepare ./dev/data",
23
27
  "sim": "node -r esbuild-register ./dev/simulate.ts",
24
28
  "sim:sqlite": "node -r esbuild-register ./dev/sqlite/index.ts",
25
- "test": "ava test",
29
+ "test": "ava test --timeout=60s",
26
30
  "build": "pnpm build:cli && pnpm build:utils",
27
31
  "build:cli": "esbuild ./src/cli/index.ts --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild --external:drizzle-orm-pg --external:drizzle-orm-sqlite --external:drizzle-orm-mysql --external:drizzle-orm --external:pg-native",
28
32
  "build:utils": "esbuild ./src/utils.ts --bundle --platform=node --target=node10.4 --outfile=./dist/utils.js",
@@ -47,12 +51,14 @@
47
51
  "commander": "^9.4.1",
48
52
  "esbuild": "^0.15.18",
49
53
  "esbuild-register": "^3.4.2",
54
+ "glob": "^8.1.0",
50
55
  "hanji": "^0.0.5",
51
56
  "json-diff": "0.9.0",
52
57
  "zod": "^3.20.2"
53
58
  },
54
59
  "devDependencies": {
55
60
  "@types/dockerode": "^3.3.14",
61
+ "@types/glob": "^8.1.0",
56
62
  "@types/node": "^18.11.15",
57
63
  "@types/pg": "^8.6.5",
58
64
  "@typescript-eslint/eslint-plugin": "^5.46.1",
@@ -60,7 +66,7 @@
60
66
  "ava": "^5.1.0",
61
67
  "dockerode": "^3.3.4",
62
68
  "drizzle-kit": "^0.16.8",
63
- "drizzle-orm": "0.21.0-2e66963",
69
+ "drizzle-orm": "0.21.0-a3981ce",
64
70
  "esbuild": "^0.15.7",
65
71
  "esbuild-register": "^3.3.3",
66
72
  "eslint": "^8.29.0",
package/utils.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -6669,7 +6670,7 @@ __export(utils_exports, {
6669
6670
  mapValues: () => mapValues,
6670
6671
  prepareMigrationFolder: () => prepareMigrationFolder,
6671
6672
  prepareMigrationMeta: () => prepareMigrationMeta,
6672
- prepareOutFolder: () => prepareOutFolder,
6673
+ prepareOutFolder: () => prepareOutFolder2,
6673
6674
  schemaRenameKey: () => schemaRenameKey,
6674
6675
  snapshotsPriorV4: () => snapshotsPriorV4,
6675
6676
  statementsForDiffs: () => statementsForDiffs,
@@ -7169,7 +7170,7 @@ var info = (msg, greyMsg = "") => {
7169
7170
  var originUUID = "00000000-0000-0000-0000-000000000000";
7170
7171
  var snapshotVersion = "5";
7171
7172
 
7172
- // node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs
7173
+ // node_modules/.pnpm/zod@3.20.6/node_modules/zod/lib/index.mjs
7173
7174
  var util;
7174
7175
  (function(util2) {
7175
7176
  util2.assertEqual = (val) => val;
@@ -7584,7 +7585,7 @@ var OK = (value) => ({ status: "valid", value });
7584
7585
  var isAborted = (x) => x.status === "aborted";
7585
7586
  var isDirty = (x) => x.status === "dirty";
7586
7587
  var isValid = (x) => x.status === "valid";
7587
- var isAsync = (x) => typeof Promise !== void 0 && x instanceof Promise;
7588
+ var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
7588
7589
  var errorUtil;
7589
7590
  (function(errorUtil2) {
7590
7591
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
@@ -7800,28 +7801,29 @@ var ZodType = class {
7800
7801
  return this._refinement(refinement);
7801
7802
  }
7802
7803
  optional() {
7803
- return ZodOptional.create(this);
7804
+ return ZodOptional.create(this, this._def);
7804
7805
  }
7805
7806
  nullable() {
7806
- return ZodNullable.create(this);
7807
+ return ZodNullable.create(this, this._def);
7807
7808
  }
7808
7809
  nullish() {
7809
- return this.optional().nullable();
7810
+ return this.nullable().optional();
7810
7811
  }
7811
7812
  array() {
7812
- return ZodArray.create(this);
7813
+ return ZodArray.create(this, this._def);
7813
7814
  }
7814
7815
  promise() {
7815
- return ZodPromise.create(this);
7816
+ return ZodPromise.create(this, this._def);
7816
7817
  }
7817
7818
  or(option) {
7818
- return ZodUnion.create([this, option]);
7819
+ return ZodUnion.create([this, option], this._def);
7819
7820
  }
7820
7821
  and(incoming) {
7821
- return ZodIntersection.create(this, incoming);
7822
+ return ZodIntersection.create(this, incoming, this._def);
7822
7823
  }
7823
7824
  transform(transform) {
7824
7825
  return new ZodEffects({
7826
+ ...processCreateParams(this._def),
7825
7827
  schema: this,
7826
7828
  typeName: ZodFirstPartyTypeKind.ZodEffects,
7827
7829
  effect: { type: "transform", transform }
@@ -7830,6 +7832,7 @@ var ZodType = class {
7830
7832
  default(def) {
7831
7833
  const defaultValueFunc = typeof def === "function" ? def : () => def;
7832
7834
  return new ZodDefault({
7835
+ ...processCreateParams(this._def),
7833
7836
  innerType: this,
7834
7837
  defaultValue: defaultValueFunc,
7835
7838
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -7839,14 +7842,15 @@ var ZodType = class {
7839
7842
  return new ZodBranded({
7840
7843
  typeName: ZodFirstPartyTypeKind.ZodBranded,
7841
7844
  type: this,
7842
- ...processCreateParams(void 0)
7845
+ ...processCreateParams(this._def)
7843
7846
  });
7844
7847
  }
7845
7848
  catch(def) {
7846
- const defaultValueFunc = typeof def === "function" ? def : () => def;
7849
+ const catchValueFunc = typeof def === "function" ? def : () => def;
7847
7850
  return new ZodCatch({
7851
+ ...processCreateParams(this._def),
7848
7852
  innerType: this,
7849
- defaultValue: defaultValueFunc,
7853
+ catchValue: catchValueFunc,
7850
7854
  typeName: ZodFirstPartyTypeKind.ZodCatch
7851
7855
  });
7852
7856
  }
@@ -7868,24 +7872,25 @@ var ZodType = class {
7868
7872
  }
7869
7873
  };
7870
7874
  var cuidRegex = /^c[^\s-]{8,}$/i;
7875
+ var cuid2Regex = /^[a-z][a-z0-9]*$/;
7871
7876
  var uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
7872
- var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
7877
+ var emailRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;
7873
7878
  var datetimeRegex = (args) => {
7874
7879
  if (args.precision) {
7875
7880
  if (args.offset) {
7876
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
7881
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
7877
7882
  } else {
7878
7883
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
7879
7884
  }
7880
7885
  } else if (args.precision === 0) {
7881
7886
  if (args.offset) {
7882
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
7887
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
7883
7888
  } else {
7884
7889
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
7885
7890
  }
7886
7891
  } else {
7887
7892
  if (args.offset) {
7888
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
7893
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
7889
7894
  } else {
7890
7895
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
7891
7896
  }
@@ -8007,6 +8012,16 @@ var ZodString = class extends ZodType {
8007
8012
  });
8008
8013
  status.dirty();
8009
8014
  }
8015
+ } else if (check.kind === "cuid2") {
8016
+ if (!cuid2Regex.test(input.data)) {
8017
+ ctx = this._getOrReturnCtx(input, ctx);
8018
+ addIssueToContext(ctx, {
8019
+ validation: "cuid2",
8020
+ code: ZodIssueCode.invalid_string,
8021
+ message: check.message
8022
+ });
8023
+ status.dirty();
8024
+ }
8010
8025
  } else if (check.kind === "url") {
8011
8026
  try {
8012
8027
  new URL(input.data);
@@ -8088,6 +8103,9 @@ var ZodString = class extends ZodType {
8088
8103
  cuid(message) {
8089
8104
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
8090
8105
  }
8106
+ cuid2(message) {
8107
+ return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
8108
+ }
8091
8109
  datetime(options) {
8092
8110
  var _a;
8093
8111
  if (typeof options === "string") {
@@ -8162,6 +8180,9 @@ var ZodString = class extends ZodType {
8162
8180
  get isCUID() {
8163
8181
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
8164
8182
  }
8183
+ get isCUID2() {
8184
+ return !!this._def.checks.find((ch) => ch.kind === "cuid2");
8185
+ }
8165
8186
  get minLength() {
8166
8187
  let min = null;
8167
8188
  for (const ch of this._def.checks) {
@@ -8392,7 +8413,22 @@ var ZodNumber = class extends ZodType {
8392
8413
  return max;
8393
8414
  }
8394
8415
  get isInt() {
8395
- return !!this._def.checks.find((ch) => ch.kind === "int");
8416
+ return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
8417
+ }
8418
+ get isFinite() {
8419
+ let max = null, min = null;
8420
+ for (const ch of this._def.checks) {
8421
+ if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
8422
+ return true;
8423
+ } else if (ch.kind === "min") {
8424
+ if (min === null || ch.value > min)
8425
+ min = ch.value;
8426
+ } else if (ch.kind === "max") {
8427
+ if (max === null || ch.value < max)
8428
+ max = ch.value;
8429
+ }
8430
+ }
8431
+ return Number.isFinite(min) && Number.isFinite(max);
8396
8432
  }
8397
8433
  };
8398
8434
  ZodNumber.create = (params) => {
@@ -8749,13 +8785,13 @@ var ZodArray = class extends ZodType {
8749
8785
  }
8750
8786
  }
8751
8787
  if (ctx.common.async) {
8752
- return Promise.all(ctx.data.map((item, i) => {
8788
+ return Promise.all([...ctx.data].map((item, i) => {
8753
8789
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
8754
8790
  })).then((result2) => {
8755
8791
  return ParseStatus.mergeArray(status, result2);
8756
8792
  });
8757
8793
  }
8758
- const result = ctx.data.map((item, i) => {
8794
+ const result = [...ctx.data].map((item, i) => {
8759
8795
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
8760
8796
  });
8761
8797
  return ParseStatus.mergeArray(status, result);
@@ -8804,15 +8840,6 @@ var objectUtil;
8804
8840
  };
8805
8841
  };
8806
8842
  })(objectUtil || (objectUtil = {}));
8807
- var AugmentFactory = (def) => (augmentation) => {
8808
- return new ZodObject({
8809
- ...def,
8810
- shape: () => ({
8811
- ...def.shape(),
8812
- ...augmentation
8813
- })
8814
- });
8815
- };
8816
8843
  function deepPartialify(schema3) {
8817
8844
  if (schema3 instanceof ZodObject) {
8818
8845
  const newShape = {};
@@ -8841,8 +8868,7 @@ var ZodObject = class extends ZodType {
8841
8868
  super(...arguments);
8842
8869
  this._cached = null;
8843
8870
  this.nonstrict = this.passthrough;
8844
- this.augment = AugmentFactory(this._def);
8845
- this.extend = AugmentFactory(this._def);
8871
+ this.augment = this.extend;
8846
8872
  }
8847
8873
  _getCached() {
8848
8874
  if (this._cached !== null)
@@ -8971,8 +8997,14 @@ var ZodObject = class extends ZodType {
8971
8997
  unknownKeys: "passthrough"
8972
8998
  });
8973
8999
  }
8974
- setKey(key, schema3) {
8975
- return this.augment({ [key]: schema3 });
9000
+ extend(augmentation) {
9001
+ return new ZodObject({
9002
+ ...this._def,
9003
+ shape: () => ({
9004
+ ...this._def.shape(),
9005
+ ...augmentation
9006
+ })
9007
+ });
8976
9008
  }
8977
9009
  merge(merging) {
8978
9010
  const merged = new ZodObject({
@@ -8983,6 +9015,9 @@ var ZodObject = class extends ZodType {
8983
9015
  });
8984
9016
  return merged;
8985
9017
  }
9018
+ setKey(key, schema3) {
9019
+ return this.augment({ [key]: schema3 });
9020
+ }
8986
9021
  catchall(index4) {
8987
9022
  return new ZodObject({
8988
9023
  ...this._def,
@@ -8991,9 +9026,10 @@ var ZodObject = class extends ZodType {
8991
9026
  }
8992
9027
  pick(mask) {
8993
9028
  const shape = {};
8994
- util.objectKeys(mask).map((key) => {
8995
- if (this.shape[key])
9029
+ util.objectKeys(mask).forEach((key) => {
9030
+ if (mask[key] && this.shape[key]) {
8996
9031
  shape[key] = this.shape[key];
9032
+ }
8997
9033
  });
8998
9034
  return new ZodObject({
8999
9035
  ...this._def,
@@ -9002,8 +9038,8 @@ var ZodObject = class extends ZodType {
9002
9038
  }
9003
9039
  omit(mask) {
9004
9040
  const shape = {};
9005
- util.objectKeys(this.shape).map((key) => {
9006
- if (util.objectKeys(mask).indexOf(key) === -1) {
9041
+ util.objectKeys(this.shape).forEach((key) => {
9042
+ if (!mask[key]) {
9007
9043
  shape[key] = this.shape[key];
9008
9044
  }
9009
9045
  });
@@ -9017,24 +9053,14 @@ var ZodObject = class extends ZodType {
9017
9053
  }
9018
9054
  partial(mask) {
9019
9055
  const newShape = {};
9020
- if (mask) {
9021
- util.objectKeys(this.shape).map((key) => {
9022
- if (util.objectKeys(mask).indexOf(key) === -1) {
9023
- newShape[key] = this.shape[key];
9024
- } else {
9025
- newShape[key] = this.shape[key].optional();
9026
- }
9027
- });
9028
- return new ZodObject({
9029
- ...this._def,
9030
- shape: () => newShape
9031
- });
9032
- } else {
9033
- for (const key in this.shape) {
9034
- const fieldSchema = this.shape[key];
9056
+ util.objectKeys(this.shape).forEach((key) => {
9057
+ const fieldSchema = this.shape[key];
9058
+ if (mask && !mask[key]) {
9059
+ newShape[key] = fieldSchema;
9060
+ } else {
9035
9061
  newShape[key] = fieldSchema.optional();
9036
9062
  }
9037
- }
9063
+ });
9038
9064
  return new ZodObject({
9039
9065
  ...this._def,
9040
9066
  shape: () => newShape
@@ -9042,21 +9068,10 @@ var ZodObject = class extends ZodType {
9042
9068
  }
9043
9069
  required(mask) {
9044
9070
  const newShape = {};
9045
- if (mask) {
9046
- util.objectKeys(this.shape).map((key) => {
9047
- if (util.objectKeys(mask).indexOf(key) === -1) {
9048
- newShape[key] = this.shape[key];
9049
- } else {
9050
- const fieldSchema = this.shape[key];
9051
- let newField = fieldSchema;
9052
- while (newField instanceof ZodOptional) {
9053
- newField = newField._def.innerType;
9054
- }
9055
- newShape[key] = newField;
9056
- }
9057
- });
9058
- } else {
9059
- for (const key in this.shape) {
9071
+ util.objectKeys(this.shape).forEach((key) => {
9072
+ if (mask && !mask[key]) {
9073
+ newShape[key] = this.shape[key];
9074
+ } else {
9060
9075
  const fieldSchema = this.shape[key];
9061
9076
  let newField = fieldSchema;
9062
9077
  while (newField instanceof ZodOptional) {
@@ -9064,7 +9079,7 @@ var ZodObject = class extends ZodType {
9064
9079
  }
9065
9080
  newShape[key] = newField;
9066
9081
  }
9067
- }
9082
+ });
9068
9083
  return new ZodObject({
9069
9084
  ...this._def,
9070
9085
  shape: () => newShape
@@ -9404,7 +9419,7 @@ var ZodTuple = class extends ZodType {
9404
9419
  });
9405
9420
  status.dirty();
9406
9421
  }
9407
- const items = ctx.data.map((item, itemIndex) => {
9422
+ const items = [...ctx.data].map((item, itemIndex) => {
9408
9423
  const schema3 = this._def.items[itemIndex] || this._def.rest;
9409
9424
  if (!schema3)
9410
9425
  return null;
@@ -9771,6 +9786,7 @@ var ZodLiteral = class extends ZodType {
9771
9786
  if (input.data !== this._def.value) {
9772
9787
  const ctx = this._getOrReturnCtx(input);
9773
9788
  addIssueToContext(ctx, {
9789
+ received: ctx.data,
9774
9790
  code: ZodIssueCode.invalid_literal,
9775
9791
  expected: this._def.value
9776
9792
  });
@@ -9844,6 +9860,12 @@ var ZodEnum = class extends ZodType {
9844
9860
  }
9845
9861
  return enumValues;
9846
9862
  }
9863
+ extract(values) {
9864
+ return ZodEnum.create(values);
9865
+ }
9866
+ exclude(values) {
9867
+ return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
9868
+ }
9847
9869
  };
9848
9870
  ZodEnum.create = createZodEnum;
9849
9871
  var ZodNativeEnum = class extends ZodType {
@@ -9882,6 +9904,9 @@ ZodNativeEnum.create = (values, params) => {
9882
9904
  });
9883
9905
  };
9884
9906
  var ZodPromise = class extends ZodType {
9907
+ unwrap() {
9908
+ return this._def.type;
9909
+ }
9885
9910
  _parse(input) {
9886
9911
  const { ctx } = this._processInputParams(input);
9887
9912
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -10095,23 +10120,29 @@ var ZodCatch = class extends ZodType {
10095
10120
  const result = this._def.innerType._parse({
10096
10121
  data: ctx.data,
10097
10122
  path: ctx.path,
10098
- parent: ctx
10123
+ parent: {
10124
+ ...ctx,
10125
+ common: {
10126
+ ...ctx.common,
10127
+ issues: []
10128
+ }
10129
+ }
10099
10130
  });
10100
10131
  if (isAsync(result)) {
10101
10132
  return result.then((result2) => {
10102
10133
  return {
10103
10134
  status: "valid",
10104
- value: result2.status === "valid" ? result2.value : this._def.defaultValue()
10135
+ value: result2.status === "valid" ? result2.value : this._def.catchValue()
10105
10136
  };
10106
10137
  });
10107
10138
  } else {
10108
10139
  return {
10109
10140
  status: "valid",
10110
- value: result.status === "valid" ? result.value : this._def.defaultValue()
10141
+ value: result.status === "valid" ? result.value : this._def.catchValue()
10111
10142
  };
10112
10143
  }
10113
10144
  }
10114
- removeDefault() {
10145
+ removeCatch() {
10115
10146
  return this._def.innerType;
10116
10147
  }
10117
10148
  };
@@ -10119,7 +10150,7 @@ ZodCatch.create = (type, params) => {
10119
10150
  return new ZodCatch({
10120
10151
  innerType: type,
10121
10152
  typeName: ZodFirstPartyTypeKind.ZodCatch,
10122
- defaultValue: typeof params.default === "function" ? params.default : () => params.default,
10153
+ catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
10123
10154
  ...processCreateParams(params)
10124
10155
  });
10125
10156
  };
@@ -11052,13 +11083,26 @@ var pgNativeTypes = /* @__PURE__ */ new Set([
11052
11083
  "interval",
11053
11084
  "bigint",
11054
11085
  "bigserial",
11055
- "double precision"
11086
+ "double precision",
11087
+ "interval year",
11088
+ "interval month",
11089
+ "interval day",
11090
+ "interval hour",
11091
+ "interval minute",
11092
+ "interval second",
11093
+ "interval year to month",
11094
+ "interval day to hour",
11095
+ "interval day to minute",
11096
+ "interval day to second",
11097
+ "interval hour to minute",
11098
+ "interval hour to second",
11099
+ "interval minute to second"
11056
11100
  ]);
11057
11101
  var isPgNativeType = (it) => {
11058
11102
  if (pgNativeTypes.has(it))
11059
11103
  return true;
11060
11104
  const toCheck = it.replace(/ /g, "");
11061
- return toCheck.startsWith("varchar(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(");
11105
+ return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(");
11062
11106
  };
11063
11107
  var Convertor = class {
11064
11108
  };
@@ -11956,7 +12000,6 @@ convertors.push(new PgAlterTableAlterColumnDropNotNullConvertor());
11956
12000
  convertors.push(new PgAlterTableAlterColumnSetDefaultConvertor());
11957
12001
  convertors.push(new PgAlterTableAlterColumnDropDefaultConvertor());
11958
12002
  convertors.push(new MySqlModifyColumn());
11959
- convertors.push(new MySqlAlterTableDropColumnConvertor());
11960
12003
  convertors.push(new MySqlAlterTableAlterColumnSetDefaultConvertor());
11961
12004
  convertors.push(new MySqlAlterTableAlterColumnDropDefaultConvertor());
11962
12005
  convertors.push(new PgCreateForeignKeyConvertor());
@@ -11993,7 +12036,7 @@ var fromJson = (statements, dialect3) => {
11993
12036
  });
11994
12037
  const convertor = filtered.length === 1 ? filtered[0] : void 0;
11995
12038
  if (!convertor) {
11996
- console.log("no convertor:", statement.type);
12039
+ console.log("no convertor:", statement.type, dialect3);
11997
12040
  return "dry run";
11998
12041
  }
11999
12042
  return convertor.convert(statement);
@@ -12946,7 +12989,7 @@ var snapshotsPriorV4 = (out) => {
12946
12989
  return pathJson;
12947
12990
  });
12948
12991
  };
12949
- var prepareOutFolder = (out, dialect3) => {
12992
+ var prepareOutFolder2 = (out, dialect3) => {
12950
12993
  const meta = (0, import_path.join)(out, "meta");
12951
12994
  const journalPath = (0, import_path.join)(meta, "_journal.json");
12952
12995
  if (!(0, import_fs.existsSync)((0, import_path.join)(out, "meta"))) {
@@ -12970,7 +13013,7 @@ var validatorForDialect = (dialect3) => {
12970
13013
  case "pg":
12971
13014
  return { validator: backwardCompatiblePgSchema, version: 5 };
12972
13015
  case "sqlite":
12973
- return { validator: backwardCompatibleSqliteSchema, version: 4 };
13016
+ return { validator: backwardCompatibleSqliteSchema, version: 5 };
12974
13017
  case "mysql":
12975
13018
  return { validator: backwardCompatibleMysqlSchema, version: 5 };
12976
13019
  }
@@ -13019,7 +13062,7 @@ var validateWithReport = (snapshots, dialect3) => {
13019
13062
  return result;
13020
13063
  };
13021
13064
  var prepareMigrationFolder = (outFolder = "drizzle", dialect3) => {
13022
- const { snapshots, journal } = prepareOutFolder(outFolder, dialect3);
13065
+ const { snapshots, journal } = prepareOutFolder2(outFolder, dialect3);
13023
13066
  const report = validateWithReport(snapshots, dialect3);
13024
13067
  if (report.nonLatest.length > 0) {
13025
13068
  console.log(