drizzle-kit 0.21.2-ae19ee7 → 0.21.2-cf9fe8d

Sign up to get free protection for your applications and to get access to all the features.
package/utils.mjs CHANGED
@@ -1068,7 +1068,7 @@ var info = (msg, greyMsg = "") => {
1068
1068
 
1069
1069
  // src/global.ts
1070
1070
  var originUUID = "00000000-0000-0000-0000-000000000000";
1071
- var snapshotVersion = "6";
1071
+ var snapshotVersion = "7";
1072
1072
 
1073
1073
  // node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
1074
1074
  var util;
@@ -5051,10 +5051,48 @@ var pgSchemaV1 = objectType({
5051
5051
  tables: recordType(stringType(), tableV1),
5052
5052
  enums: recordType(stringType(), enumSchemaV1)
5053
5053
  }).strict();
5054
+ var indexColumn = objectType({
5055
+ expression: stringType(),
5056
+ isExpression: booleanType(),
5057
+ asc: booleanType(),
5058
+ nulls: stringType().optional(),
5059
+ opclass: stringType().optional()
5060
+ });
5054
5061
  var index2 = objectType({
5062
+ name: stringType(),
5063
+ columns: indexColumn.array(),
5064
+ isUnique: booleanType(),
5065
+ with: recordType(stringType(), anyType()).optional(),
5066
+ method: stringType().default("btree"),
5067
+ where: stringType().optional(),
5068
+ concurrently: booleanType().default(false)
5069
+ }).strict();
5070
+ var indexV4 = objectType({
5055
5071
  name: stringType(),
5056
5072
  columns: stringType().array(),
5057
- isUnique: booleanType()
5073
+ isUnique: booleanType(),
5074
+ with: recordType(stringType(), stringType()).optional(),
5075
+ method: stringType().default("btree"),
5076
+ where: stringType().optional(),
5077
+ concurrently: booleanType().default(false)
5078
+ }).strict();
5079
+ var indexV5 = objectType({
5080
+ name: stringType(),
5081
+ columns: stringType().array(),
5082
+ isUnique: booleanType(),
5083
+ with: recordType(stringType(), stringType()).optional(),
5084
+ method: stringType().default("btree"),
5085
+ where: stringType().optional(),
5086
+ concurrently: booleanType().default(false)
5087
+ }).strict();
5088
+ var indexV6 = objectType({
5089
+ name: stringType(),
5090
+ columns: stringType().array(),
5091
+ isUnique: booleanType(),
5092
+ with: recordType(stringType(), stringType()).optional(),
5093
+ method: stringType().default("btree"),
5094
+ where: stringType().optional(),
5095
+ concurrently: booleanType().default(false)
5058
5096
  }).strict();
5059
5097
  var fk2 = objectType({
5060
5098
  name: stringType(),
@@ -5096,9 +5134,27 @@ var tableV42 = objectType({
5096
5134
  name: stringType(),
5097
5135
  schema: stringType(),
5098
5136
  columns: recordType(stringType(), column2),
5099
- indexes: recordType(stringType(), index2),
5137
+ indexes: recordType(stringType(), indexV4),
5100
5138
  foreignKeys: recordType(stringType(), fk2)
5101
5139
  }).strict();
5140
+ var tableV6 = objectType({
5141
+ name: stringType(),
5142
+ schema: stringType(),
5143
+ columns: recordType(stringType(), column2),
5144
+ indexes: recordType(stringType(), indexV6),
5145
+ foreignKeys: recordType(stringType(), fk2),
5146
+ compositePrimaryKeys: recordType(stringType(), compositePK2),
5147
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
5148
+ }).strict();
5149
+ var tableV5 = objectType({
5150
+ name: stringType(),
5151
+ schema: stringType(),
5152
+ columns: recordType(stringType(), column2),
5153
+ indexes: recordType(stringType(), indexV5),
5154
+ foreignKeys: recordType(stringType(), fk2),
5155
+ compositePrimaryKeys: recordType(stringType(), compositePK2),
5156
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
5157
+ }).strict();
5102
5158
  var table2 = objectType({
5103
5159
  name: stringType(),
5104
5160
  schema: stringType(),
@@ -5143,7 +5199,7 @@ var pgSchemaInternalV4 = objectType({
5143
5199
  var pgSchemaInternalV5 = objectType({
5144
5200
  version: literalType("5"),
5145
5201
  dialect: literalType("pg"),
5146
- tables: recordType(stringType(), table2),
5202
+ tables: recordType(stringType(), tableV5),
5147
5203
  enums: recordType(stringType(), enumSchemaV1),
5148
5204
  schemas: recordType(stringType(), stringType()),
5149
5205
  _meta: objectType({
@@ -5153,6 +5209,19 @@ var pgSchemaInternalV5 = objectType({
5153
5209
  }),
5154
5210
  internal: kitInternals2
5155
5211
  }).strict();
5212
+ var pgSchemaInternalV6 = objectType({
5213
+ version: literalType("6"),
5214
+ dialect: literalType("postgresql"),
5215
+ tables: recordType(stringType(), tableV6),
5216
+ enums: recordType(stringType(), enumSchema),
5217
+ schemas: recordType(stringType(), stringType()),
5218
+ _meta: objectType({
5219
+ schemas: recordType(stringType(), stringType()),
5220
+ tables: recordType(stringType(), stringType()),
5221
+ columns: recordType(stringType(), stringType())
5222
+ }),
5223
+ internal: kitInternals2
5224
+ }).strict();
5156
5225
  var pgSchemaExternal = objectType({
5157
5226
  version: literalType("5"),
5158
5227
  dialect: literalType("pg"),
@@ -5166,7 +5235,7 @@ var pgSchemaExternal = objectType({
5166
5235
  })
5167
5236
  }).strict();
5168
5237
  var pgSchemaInternal = objectType({
5169
- version: literalType("6"),
5238
+ version: literalType("7"),
5170
5239
  dialect: literalType("postgresql"),
5171
5240
  tables: recordType(stringType(), table2),
5172
5241
  enums: recordType(stringType(), enumSchema),
@@ -5201,18 +5270,30 @@ var pgSchemaSquashedV4 = objectType({
5201
5270
  enums: recordType(stringType(), enumSchemaV1),
5202
5271
  schemas: recordType(stringType(), stringType())
5203
5272
  }).strict();
5204
- var pgSchemaSquashed = objectType({
5273
+ var pgSchemaSquashedV6 = objectType({
5205
5274
  version: literalType("6"),
5206
5275
  dialect: literalType("postgresql"),
5207
5276
  tables: recordType(stringType(), tableSquashed2),
5208
5277
  enums: recordType(stringType(), enumSchema),
5209
5278
  schemas: recordType(stringType(), stringType())
5210
5279
  }).strict();
5280
+ var pgSchemaSquashed = objectType({
5281
+ version: literalType("7"),
5282
+ dialect: literalType("postgresql"),
5283
+ tables: recordType(stringType(), tableSquashed2),
5284
+ enums: recordType(stringType(), enumSchema),
5285
+ schemas: recordType(stringType(), stringType())
5286
+ }).strict();
5211
5287
  var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
5212
5288
  var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
5213
5289
  var pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash2);
5290
+ var pgSchemaV6 = pgSchemaInternalV6.merge(schemaHash2);
5214
5291
  var pgSchema = pgSchemaInternal.merge(schemaHash2);
5215
- var backwardCompatiblePgSchema = unionType([pgSchemaV5, pgSchema]);
5292
+ var backwardCompatiblePgSchema = unionType([
5293
+ pgSchemaV5,
5294
+ pgSchemaV6,
5295
+ pgSchema
5296
+ ]);
5216
5297
  var dryPg = pgSchema.parse({
5217
5298
  version: snapshotVersion,
5218
5299
  dialect: "postgresql",
@@ -5390,7 +5471,7 @@ var prepareOutFolder = (out, dialect3) => {
5390
5471
  var validatorForDialect = (dialect3) => {
5391
5472
  switch (dialect3) {
5392
5473
  case "postgresql":
5393
- return { validator: backwardCompatiblePgSchema, version: 6 };
5474
+ return { validator: backwardCompatiblePgSchema, version: 7 };
5394
5475
  case "sqlite":
5395
5476
  return { validator: backwardCompatibleSqliteSchema, version: 6 };
5396
5477
  case "mysql":
@@ -5413,6 +5494,7 @@ var validateWithReport = (snapshots, dialect3) => {
5413
5494
  }
5414
5495
  const result2 = validator.safeParse(raw);
5415
5496
  if (!result2.success) {
5497
+ console.error(result2.error);
5416
5498
  accum.malformed.push(it);
5417
5499
  return accum;
5418
5500
  }