drizzle-kit 0.21.4-b5744a6 → 0.22.0-12a1bf8
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 +853 -360
- package/index.d.mts +5 -3
- package/index.d.ts +5 -3
- package/package.json +4 -4
- package/payload.d.mts +96 -10
- package/payload.d.ts +96 -10
- package/payload.js +2142 -1183
- package/payload.mjs +2236 -1270
- package/utils-studio.js +175 -23
- package/utils-studio.mjs +175 -23
- package/utils.js +89 -8
- package/utils.mjs +89 -8
package/utils.js
CHANGED
|
@@ -1078,7 +1078,7 @@ var info = (msg, greyMsg = "") => {
|
|
|
1078
1078
|
|
|
1079
1079
|
// src/global.ts
|
|
1080
1080
|
var originUUID = "00000000-0000-0000-0000-000000000000";
|
|
1081
|
-
var snapshotVersion = "
|
|
1081
|
+
var snapshotVersion = "7";
|
|
1082
1082
|
function assertUnreachable(x) {
|
|
1083
1083
|
throw new Error("Didn't expect to get here");
|
|
1084
1084
|
}
|
|
@@ -5064,10 +5064,48 @@ var pgSchemaV1 = objectType({
|
|
|
5064
5064
|
tables: recordType(stringType(), tableV1),
|
|
5065
5065
|
enums: recordType(stringType(), enumSchemaV1)
|
|
5066
5066
|
}).strict();
|
|
5067
|
+
var indexColumn = objectType({
|
|
5068
|
+
expression: stringType(),
|
|
5069
|
+
isExpression: booleanType(),
|
|
5070
|
+
asc: booleanType(),
|
|
5071
|
+
nulls: stringType().optional(),
|
|
5072
|
+
opclass: stringType().optional()
|
|
5073
|
+
});
|
|
5067
5074
|
var index2 = objectType({
|
|
5075
|
+
name: stringType(),
|
|
5076
|
+
columns: indexColumn.array(),
|
|
5077
|
+
isUnique: booleanType(),
|
|
5078
|
+
with: recordType(stringType(), anyType()).optional(),
|
|
5079
|
+
method: stringType().default("btree"),
|
|
5080
|
+
where: stringType().optional(),
|
|
5081
|
+
concurrently: booleanType().default(false)
|
|
5082
|
+
}).strict();
|
|
5083
|
+
var indexV4 = objectType({
|
|
5068
5084
|
name: stringType(),
|
|
5069
5085
|
columns: stringType().array(),
|
|
5070
|
-
isUnique: booleanType()
|
|
5086
|
+
isUnique: booleanType(),
|
|
5087
|
+
with: recordType(stringType(), stringType()).optional(),
|
|
5088
|
+
method: stringType().default("btree"),
|
|
5089
|
+
where: stringType().optional(),
|
|
5090
|
+
concurrently: booleanType().default(false)
|
|
5091
|
+
}).strict();
|
|
5092
|
+
var indexV5 = objectType({
|
|
5093
|
+
name: stringType(),
|
|
5094
|
+
columns: stringType().array(),
|
|
5095
|
+
isUnique: booleanType(),
|
|
5096
|
+
with: recordType(stringType(), stringType()).optional(),
|
|
5097
|
+
method: stringType().default("btree"),
|
|
5098
|
+
where: stringType().optional(),
|
|
5099
|
+
concurrently: booleanType().default(false)
|
|
5100
|
+
}).strict();
|
|
5101
|
+
var indexV6 = objectType({
|
|
5102
|
+
name: stringType(),
|
|
5103
|
+
columns: stringType().array(),
|
|
5104
|
+
isUnique: booleanType(),
|
|
5105
|
+
with: recordType(stringType(), stringType()).optional(),
|
|
5106
|
+
method: stringType().default("btree"),
|
|
5107
|
+
where: stringType().optional(),
|
|
5108
|
+
concurrently: booleanType().default(false)
|
|
5071
5109
|
}).strict();
|
|
5072
5110
|
var fk2 = objectType({
|
|
5073
5111
|
name: stringType(),
|
|
@@ -5109,9 +5147,27 @@ var tableV42 = objectType({
|
|
|
5109
5147
|
name: stringType(),
|
|
5110
5148
|
schema: stringType(),
|
|
5111
5149
|
columns: recordType(stringType(), column2),
|
|
5112
|
-
indexes: recordType(stringType(),
|
|
5150
|
+
indexes: recordType(stringType(), indexV4),
|
|
5113
5151
|
foreignKeys: recordType(stringType(), fk2)
|
|
5114
5152
|
}).strict();
|
|
5153
|
+
var tableV6 = objectType({
|
|
5154
|
+
name: stringType(),
|
|
5155
|
+
schema: stringType(),
|
|
5156
|
+
columns: recordType(stringType(), column2),
|
|
5157
|
+
indexes: recordType(stringType(), indexV6),
|
|
5158
|
+
foreignKeys: recordType(stringType(), fk2),
|
|
5159
|
+
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
|
5160
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
|
5161
|
+
}).strict();
|
|
5162
|
+
var tableV5 = objectType({
|
|
5163
|
+
name: stringType(),
|
|
5164
|
+
schema: stringType(),
|
|
5165
|
+
columns: recordType(stringType(), column2),
|
|
5166
|
+
indexes: recordType(stringType(), indexV5),
|
|
5167
|
+
foreignKeys: recordType(stringType(), fk2),
|
|
5168
|
+
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
|
5169
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
|
5170
|
+
}).strict();
|
|
5115
5171
|
var table2 = objectType({
|
|
5116
5172
|
name: stringType(),
|
|
5117
5173
|
schema: stringType(),
|
|
@@ -5156,7 +5212,7 @@ var pgSchemaInternalV4 = objectType({
|
|
|
5156
5212
|
var pgSchemaInternalV5 = objectType({
|
|
5157
5213
|
version: literalType("5"),
|
|
5158
5214
|
dialect: literalType("pg"),
|
|
5159
|
-
tables: recordType(stringType(),
|
|
5215
|
+
tables: recordType(stringType(), tableV5),
|
|
5160
5216
|
enums: recordType(stringType(), enumSchemaV1),
|
|
5161
5217
|
schemas: recordType(stringType(), stringType()),
|
|
5162
5218
|
_meta: objectType({
|
|
@@ -5166,6 +5222,19 @@ var pgSchemaInternalV5 = objectType({
|
|
|
5166
5222
|
}),
|
|
5167
5223
|
internal: kitInternals2
|
|
5168
5224
|
}).strict();
|
|
5225
|
+
var pgSchemaInternalV6 = objectType({
|
|
5226
|
+
version: literalType("6"),
|
|
5227
|
+
dialect: literalType("postgresql"),
|
|
5228
|
+
tables: recordType(stringType(), tableV6),
|
|
5229
|
+
enums: recordType(stringType(), enumSchema),
|
|
5230
|
+
schemas: recordType(stringType(), stringType()),
|
|
5231
|
+
_meta: objectType({
|
|
5232
|
+
schemas: recordType(stringType(), stringType()),
|
|
5233
|
+
tables: recordType(stringType(), stringType()),
|
|
5234
|
+
columns: recordType(stringType(), stringType())
|
|
5235
|
+
}),
|
|
5236
|
+
internal: kitInternals2
|
|
5237
|
+
}).strict();
|
|
5169
5238
|
var pgSchemaExternal = objectType({
|
|
5170
5239
|
version: literalType("5"),
|
|
5171
5240
|
dialect: literalType("pg"),
|
|
@@ -5179,7 +5248,7 @@ var pgSchemaExternal = objectType({
|
|
|
5179
5248
|
})
|
|
5180
5249
|
}).strict();
|
|
5181
5250
|
var pgSchemaInternal = objectType({
|
|
5182
|
-
version: literalType("
|
|
5251
|
+
version: literalType("7"),
|
|
5183
5252
|
dialect: literalType("postgresql"),
|
|
5184
5253
|
tables: recordType(stringType(), table2),
|
|
5185
5254
|
enums: recordType(stringType(), enumSchema),
|
|
@@ -5214,18 +5283,30 @@ var pgSchemaSquashedV4 = objectType({
|
|
|
5214
5283
|
enums: recordType(stringType(), enumSchemaV1),
|
|
5215
5284
|
schemas: recordType(stringType(), stringType())
|
|
5216
5285
|
}).strict();
|
|
5217
|
-
var
|
|
5286
|
+
var pgSchemaSquashedV6 = objectType({
|
|
5218
5287
|
version: literalType("6"),
|
|
5219
5288
|
dialect: literalType("postgresql"),
|
|
5220
5289
|
tables: recordType(stringType(), tableSquashed2),
|
|
5221
5290
|
enums: recordType(stringType(), enumSchema),
|
|
5222
5291
|
schemas: recordType(stringType(), stringType())
|
|
5223
5292
|
}).strict();
|
|
5293
|
+
var pgSchemaSquashed = objectType({
|
|
5294
|
+
version: literalType("7"),
|
|
5295
|
+
dialect: literalType("postgresql"),
|
|
5296
|
+
tables: recordType(stringType(), tableSquashed2),
|
|
5297
|
+
enums: recordType(stringType(), enumSchema),
|
|
5298
|
+
schemas: recordType(stringType(), stringType())
|
|
5299
|
+
}).strict();
|
|
5224
5300
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
|
5225
5301
|
var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
|
5226
5302
|
var pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash2);
|
|
5303
|
+
var pgSchemaV6 = pgSchemaInternalV6.merge(schemaHash2);
|
|
5227
5304
|
var pgSchema = pgSchemaInternal.merge(schemaHash2);
|
|
5228
|
-
var backwardCompatiblePgSchema = unionType([
|
|
5305
|
+
var backwardCompatiblePgSchema = unionType([
|
|
5306
|
+
pgSchemaV5,
|
|
5307
|
+
pgSchemaV6,
|
|
5308
|
+
pgSchema
|
|
5309
|
+
]);
|
|
5229
5310
|
var dryPg = pgSchema.parse({
|
|
5230
5311
|
version: snapshotVersion,
|
|
5231
5312
|
dialect: "postgresql",
|
|
@@ -5404,7 +5485,7 @@ var prepareOutFolder = (out, dialect3) => {
|
|
|
5404
5485
|
var validatorForDialect = (dialect3) => {
|
|
5405
5486
|
switch (dialect3) {
|
|
5406
5487
|
case "postgresql":
|
|
5407
|
-
return { validator: backwardCompatiblePgSchema, version:
|
|
5488
|
+
return { validator: backwardCompatiblePgSchema, version: 7 };
|
|
5408
5489
|
case "sqlite":
|
|
5409
5490
|
return { validator: backwardCompatibleSqliteSchema, version: 6 };
|
|
5410
5491
|
case "mysql":
|
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 = "
|
|
1071
|
+
var snapshotVersion = "7";
|
|
1072
1072
|
function assertUnreachable(x) {
|
|
1073
1073
|
throw new Error("Didn't expect to get here");
|
|
1074
1074
|
}
|
|
@@ -5054,10 +5054,48 @@ var pgSchemaV1 = objectType({
|
|
|
5054
5054
|
tables: recordType(stringType(), tableV1),
|
|
5055
5055
|
enums: recordType(stringType(), enumSchemaV1)
|
|
5056
5056
|
}).strict();
|
|
5057
|
+
var indexColumn = objectType({
|
|
5058
|
+
expression: stringType(),
|
|
5059
|
+
isExpression: booleanType(),
|
|
5060
|
+
asc: booleanType(),
|
|
5061
|
+
nulls: stringType().optional(),
|
|
5062
|
+
opclass: stringType().optional()
|
|
5063
|
+
});
|
|
5057
5064
|
var index2 = objectType({
|
|
5065
|
+
name: stringType(),
|
|
5066
|
+
columns: indexColumn.array(),
|
|
5067
|
+
isUnique: booleanType(),
|
|
5068
|
+
with: recordType(stringType(), anyType()).optional(),
|
|
5069
|
+
method: stringType().default("btree"),
|
|
5070
|
+
where: stringType().optional(),
|
|
5071
|
+
concurrently: booleanType().default(false)
|
|
5072
|
+
}).strict();
|
|
5073
|
+
var indexV4 = objectType({
|
|
5058
5074
|
name: stringType(),
|
|
5059
5075
|
columns: stringType().array(),
|
|
5060
|
-
isUnique: booleanType()
|
|
5076
|
+
isUnique: booleanType(),
|
|
5077
|
+
with: recordType(stringType(), stringType()).optional(),
|
|
5078
|
+
method: stringType().default("btree"),
|
|
5079
|
+
where: stringType().optional(),
|
|
5080
|
+
concurrently: booleanType().default(false)
|
|
5081
|
+
}).strict();
|
|
5082
|
+
var indexV5 = objectType({
|
|
5083
|
+
name: stringType(),
|
|
5084
|
+
columns: stringType().array(),
|
|
5085
|
+
isUnique: booleanType(),
|
|
5086
|
+
with: recordType(stringType(), stringType()).optional(),
|
|
5087
|
+
method: stringType().default("btree"),
|
|
5088
|
+
where: stringType().optional(),
|
|
5089
|
+
concurrently: booleanType().default(false)
|
|
5090
|
+
}).strict();
|
|
5091
|
+
var indexV6 = objectType({
|
|
5092
|
+
name: stringType(),
|
|
5093
|
+
columns: stringType().array(),
|
|
5094
|
+
isUnique: booleanType(),
|
|
5095
|
+
with: recordType(stringType(), stringType()).optional(),
|
|
5096
|
+
method: stringType().default("btree"),
|
|
5097
|
+
where: stringType().optional(),
|
|
5098
|
+
concurrently: booleanType().default(false)
|
|
5061
5099
|
}).strict();
|
|
5062
5100
|
var fk2 = objectType({
|
|
5063
5101
|
name: stringType(),
|
|
@@ -5099,9 +5137,27 @@ var tableV42 = objectType({
|
|
|
5099
5137
|
name: stringType(),
|
|
5100
5138
|
schema: stringType(),
|
|
5101
5139
|
columns: recordType(stringType(), column2),
|
|
5102
|
-
indexes: recordType(stringType(),
|
|
5140
|
+
indexes: recordType(stringType(), indexV4),
|
|
5103
5141
|
foreignKeys: recordType(stringType(), fk2)
|
|
5104
5142
|
}).strict();
|
|
5143
|
+
var tableV6 = objectType({
|
|
5144
|
+
name: stringType(),
|
|
5145
|
+
schema: stringType(),
|
|
5146
|
+
columns: recordType(stringType(), column2),
|
|
5147
|
+
indexes: recordType(stringType(), indexV6),
|
|
5148
|
+
foreignKeys: recordType(stringType(), fk2),
|
|
5149
|
+
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
|
5150
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
|
5151
|
+
}).strict();
|
|
5152
|
+
var tableV5 = objectType({
|
|
5153
|
+
name: stringType(),
|
|
5154
|
+
schema: stringType(),
|
|
5155
|
+
columns: recordType(stringType(), column2),
|
|
5156
|
+
indexes: recordType(stringType(), indexV5),
|
|
5157
|
+
foreignKeys: recordType(stringType(), fk2),
|
|
5158
|
+
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
|
5159
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
|
5160
|
+
}).strict();
|
|
5105
5161
|
var table2 = objectType({
|
|
5106
5162
|
name: stringType(),
|
|
5107
5163
|
schema: stringType(),
|
|
@@ -5146,7 +5202,7 @@ var pgSchemaInternalV4 = objectType({
|
|
|
5146
5202
|
var pgSchemaInternalV5 = objectType({
|
|
5147
5203
|
version: literalType("5"),
|
|
5148
5204
|
dialect: literalType("pg"),
|
|
5149
|
-
tables: recordType(stringType(),
|
|
5205
|
+
tables: recordType(stringType(), tableV5),
|
|
5150
5206
|
enums: recordType(stringType(), enumSchemaV1),
|
|
5151
5207
|
schemas: recordType(stringType(), stringType()),
|
|
5152
5208
|
_meta: objectType({
|
|
@@ -5156,6 +5212,19 @@ var pgSchemaInternalV5 = objectType({
|
|
|
5156
5212
|
}),
|
|
5157
5213
|
internal: kitInternals2
|
|
5158
5214
|
}).strict();
|
|
5215
|
+
var pgSchemaInternalV6 = objectType({
|
|
5216
|
+
version: literalType("6"),
|
|
5217
|
+
dialect: literalType("postgresql"),
|
|
5218
|
+
tables: recordType(stringType(), tableV6),
|
|
5219
|
+
enums: recordType(stringType(), enumSchema),
|
|
5220
|
+
schemas: recordType(stringType(), stringType()),
|
|
5221
|
+
_meta: objectType({
|
|
5222
|
+
schemas: recordType(stringType(), stringType()),
|
|
5223
|
+
tables: recordType(stringType(), stringType()),
|
|
5224
|
+
columns: recordType(stringType(), stringType())
|
|
5225
|
+
}),
|
|
5226
|
+
internal: kitInternals2
|
|
5227
|
+
}).strict();
|
|
5159
5228
|
var pgSchemaExternal = objectType({
|
|
5160
5229
|
version: literalType("5"),
|
|
5161
5230
|
dialect: literalType("pg"),
|
|
@@ -5169,7 +5238,7 @@ var pgSchemaExternal = objectType({
|
|
|
5169
5238
|
})
|
|
5170
5239
|
}).strict();
|
|
5171
5240
|
var pgSchemaInternal = objectType({
|
|
5172
|
-
version: literalType("
|
|
5241
|
+
version: literalType("7"),
|
|
5173
5242
|
dialect: literalType("postgresql"),
|
|
5174
5243
|
tables: recordType(stringType(), table2),
|
|
5175
5244
|
enums: recordType(stringType(), enumSchema),
|
|
@@ -5204,18 +5273,30 @@ var pgSchemaSquashedV4 = objectType({
|
|
|
5204
5273
|
enums: recordType(stringType(), enumSchemaV1),
|
|
5205
5274
|
schemas: recordType(stringType(), stringType())
|
|
5206
5275
|
}).strict();
|
|
5207
|
-
var
|
|
5276
|
+
var pgSchemaSquashedV6 = objectType({
|
|
5208
5277
|
version: literalType("6"),
|
|
5209
5278
|
dialect: literalType("postgresql"),
|
|
5210
5279
|
tables: recordType(stringType(), tableSquashed2),
|
|
5211
5280
|
enums: recordType(stringType(), enumSchema),
|
|
5212
5281
|
schemas: recordType(stringType(), stringType())
|
|
5213
5282
|
}).strict();
|
|
5283
|
+
var pgSchemaSquashed = objectType({
|
|
5284
|
+
version: literalType("7"),
|
|
5285
|
+
dialect: literalType("postgresql"),
|
|
5286
|
+
tables: recordType(stringType(), tableSquashed2),
|
|
5287
|
+
enums: recordType(stringType(), enumSchema),
|
|
5288
|
+
schemas: recordType(stringType(), stringType())
|
|
5289
|
+
}).strict();
|
|
5214
5290
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
|
5215
5291
|
var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
|
5216
5292
|
var pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash2);
|
|
5293
|
+
var pgSchemaV6 = pgSchemaInternalV6.merge(schemaHash2);
|
|
5217
5294
|
var pgSchema = pgSchemaInternal.merge(schemaHash2);
|
|
5218
|
-
var backwardCompatiblePgSchema = unionType([
|
|
5295
|
+
var backwardCompatiblePgSchema = unionType([
|
|
5296
|
+
pgSchemaV5,
|
|
5297
|
+
pgSchemaV6,
|
|
5298
|
+
pgSchema
|
|
5299
|
+
]);
|
|
5219
5300
|
var dryPg = pgSchema.parse({
|
|
5220
5301
|
version: snapshotVersion,
|
|
5221
5302
|
dialect: "postgresql",
|
|
@@ -5394,7 +5475,7 @@ var prepareOutFolder = (out, dialect3) => {
|
|
|
5394
5475
|
var validatorForDialect = (dialect3) => {
|
|
5395
5476
|
switch (dialect3) {
|
|
5396
5477
|
case "postgresql":
|
|
5397
|
-
return { validator: backwardCompatiblePgSchema, version:
|
|
5478
|
+
return { validator: backwardCompatiblePgSchema, version: 7 };
|
|
5398
5479
|
case "sqlite":
|
|
5399
5480
|
return { validator: backwardCompatibleSqliteSchema, version: 6 };
|
|
5400
5481
|
case "mysql":
|