drizzle-kit 0.28.1 → 0.29.0
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/api.d.mts +347 -4
- package/api.d.ts +347 -4
- package/api.js +8682 -2972
- package/api.mjs +8679 -2972
- package/bin.cjs +47563 -44177
- package/{index-BfiZoTqG.d.mts → index-Z-1TKnbX.d.mts} +22 -7
- package/{index-BfiZoTqG.d.ts → index-Z-1TKnbX.d.ts} +22 -7
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -1
- package/utils.js +207 -96
- package/utils.mjs +207 -96
package/utils.js
CHANGED
@@ -899,30 +899,30 @@ var supports_color_default = supportsColor;
|
|
899
899
|
|
900
900
|
// ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
|
901
901
|
function stringReplaceAll(string, substring, replacer) {
|
902
|
-
let
|
903
|
-
if (
|
902
|
+
let index5 = string.indexOf(substring);
|
903
|
+
if (index5 === -1) {
|
904
904
|
return string;
|
905
905
|
}
|
906
906
|
const substringLength = substring.length;
|
907
907
|
let endIndex = 0;
|
908
908
|
let returnValue = "";
|
909
909
|
do {
|
910
|
-
returnValue += string.slice(endIndex,
|
911
|
-
endIndex =
|
912
|
-
|
913
|
-
} while (
|
910
|
+
returnValue += string.slice(endIndex, index5) + substring + replacer;
|
911
|
+
endIndex = index5 + substringLength;
|
912
|
+
index5 = string.indexOf(substring, endIndex);
|
913
|
+
} while (index5 !== -1);
|
914
914
|
returnValue += string.slice(endIndex);
|
915
915
|
return returnValue;
|
916
916
|
}
|
917
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix,
|
917
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index5) {
|
918
918
|
let endIndex = 0;
|
919
919
|
let returnValue = "";
|
920
920
|
do {
|
921
|
-
const gotCR = string[
|
922
|
-
returnValue += string.slice(endIndex, gotCR ?
|
923
|
-
endIndex =
|
924
|
-
|
925
|
-
} while (
|
921
|
+
const gotCR = string[index5 - 1] === "\r";
|
922
|
+
returnValue += string.slice(endIndex, gotCR ? index5 - 1 : index5) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
923
|
+
endIndex = index5 + 1;
|
924
|
+
index5 = string.indexOf("\n", endIndex);
|
925
|
+
} while (index5 !== -1);
|
926
926
|
returnValue += string.slice(endIndex);
|
927
927
|
return returnValue;
|
928
928
|
}
|
@@ -3175,9 +3175,9 @@ var ZodArray = class _ZodArray extends ZodType {
|
|
3175
3175
|
return this.min(1, message);
|
3176
3176
|
}
|
3177
3177
|
};
|
3178
|
-
ZodArray.create = (
|
3178
|
+
ZodArray.create = (schema4, params) => {
|
3179
3179
|
return new ZodArray({
|
3180
|
-
type:
|
3180
|
+
type: schema4,
|
3181
3181
|
minLength: null,
|
3182
3182
|
maxLength: null,
|
3183
3183
|
exactLength: null,
|
@@ -3185,30 +3185,30 @@ ZodArray.create = (schema3, params) => {
|
|
3185
3185
|
...processCreateParams(params)
|
3186
3186
|
});
|
3187
3187
|
};
|
3188
|
-
function deepPartialify(
|
3189
|
-
if (
|
3188
|
+
function deepPartialify(schema4) {
|
3189
|
+
if (schema4 instanceof ZodObject) {
|
3190
3190
|
const newShape = {};
|
3191
|
-
for (const key in
|
3192
|
-
const fieldSchema =
|
3191
|
+
for (const key in schema4.shape) {
|
3192
|
+
const fieldSchema = schema4.shape[key];
|
3193
3193
|
newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
|
3194
3194
|
}
|
3195
3195
|
return new ZodObject({
|
3196
|
-
...
|
3196
|
+
...schema4._def,
|
3197
3197
|
shape: () => newShape
|
3198
3198
|
});
|
3199
|
-
} else if (
|
3199
|
+
} else if (schema4 instanceof ZodArray) {
|
3200
3200
|
return new ZodArray({
|
3201
|
-
...
|
3202
|
-
type: deepPartialify(
|
3201
|
+
...schema4._def,
|
3202
|
+
type: deepPartialify(schema4.element)
|
3203
3203
|
});
|
3204
|
-
} else if (
|
3205
|
-
return ZodOptional.create(deepPartialify(
|
3206
|
-
} else if (
|
3207
|
-
return ZodNullable.create(deepPartialify(
|
3208
|
-
} else if (
|
3209
|
-
return ZodTuple.create(
|
3204
|
+
} else if (schema4 instanceof ZodOptional) {
|
3205
|
+
return ZodOptional.create(deepPartialify(schema4.unwrap()));
|
3206
|
+
} else if (schema4 instanceof ZodNullable) {
|
3207
|
+
return ZodNullable.create(deepPartialify(schema4.unwrap()));
|
3208
|
+
} else if (schema4 instanceof ZodTuple) {
|
3209
|
+
return ZodTuple.create(schema4.items.map((item) => deepPartialify(item)));
|
3210
3210
|
} else {
|
3211
|
-
return
|
3211
|
+
return schema4;
|
3212
3212
|
}
|
3213
3213
|
}
|
3214
3214
|
var ZodObject = class _ZodObject extends ZodType {
|
@@ -3425,8 +3425,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
3425
3425
|
// }) as any;
|
3426
3426
|
// return merged;
|
3427
3427
|
// }
|
3428
|
-
setKey(key,
|
3429
|
-
return this.augment({ [key]:
|
3428
|
+
setKey(key, schema4) {
|
3429
|
+
return this.augment({ [key]: schema4 });
|
3430
3430
|
}
|
3431
3431
|
// merge<Incoming extends AnyZodObject>(
|
3432
3432
|
// merging: Incoming
|
@@ -3449,10 +3449,10 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
3449
3449
|
// }) as any;
|
3450
3450
|
// return merged;
|
3451
3451
|
// }
|
3452
|
-
catchall(
|
3452
|
+
catchall(index5) {
|
3453
3453
|
return new _ZodObject({
|
3454
3454
|
...this._def,
|
3455
|
-
catchall:
|
3455
|
+
catchall: index5
|
3456
3456
|
});
|
3457
3457
|
}
|
3458
3458
|
pick(mask) {
|
@@ -3770,9 +3770,9 @@ function mergeValues(a, b) {
|
|
3770
3770
|
return { valid: false };
|
3771
3771
|
}
|
3772
3772
|
const newArray = [];
|
3773
|
-
for (let
|
3774
|
-
const itemA = a[
|
3775
|
-
const itemB = b[
|
3773
|
+
for (let index5 = 0; index5 < a.length; index5++) {
|
3774
|
+
const itemA = a[index5];
|
3775
|
+
const itemB = b[index5];
|
3776
3776
|
const sharedValue = mergeValues(itemA, itemB);
|
3777
3777
|
if (!sharedValue.valid) {
|
3778
3778
|
return { valid: false };
|
@@ -3872,10 +3872,10 @@ var ZodTuple = class _ZodTuple extends ZodType {
|
|
3872
3872
|
status.dirty();
|
3873
3873
|
}
|
3874
3874
|
const items = [...ctx.data].map((item, itemIndex) => {
|
3875
|
-
const
|
3876
|
-
if (!
|
3875
|
+
const schema4 = this._def.items[itemIndex] || this._def.rest;
|
3876
|
+
if (!schema4)
|
3877
3877
|
return null;
|
3878
|
-
return
|
3878
|
+
return schema4._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
3879
3879
|
}).filter((x) => !!x);
|
3880
3880
|
if (ctx.common.async) {
|
3881
3881
|
return Promise.all(items).then((results) => {
|
@@ -3978,10 +3978,10 @@ var ZodMap = class extends ZodType {
|
|
3978
3978
|
}
|
3979
3979
|
const keyType = this._def.keyType;
|
3980
3980
|
const valueType = this._def.valueType;
|
3981
|
-
const pairs = [...ctx.data.entries()].map(([key, value],
|
3981
|
+
const pairs = [...ctx.data.entries()].map(([key, value], index5) => {
|
3982
3982
|
return {
|
3983
|
-
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [
|
3984
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [
|
3983
|
+
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index5, "key"])),
|
3984
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index5, "value"]))
|
3985
3985
|
};
|
3986
3986
|
});
|
3987
3987
|
if (ctx.common.async) {
|
@@ -4409,9 +4409,9 @@ var ZodPromise = class extends ZodType {
|
|
4409
4409
|
}));
|
4410
4410
|
}
|
4411
4411
|
};
|
4412
|
-
ZodPromise.create = (
|
4412
|
+
ZodPromise.create = (schema4, params) => {
|
4413
4413
|
return new ZodPromise({
|
4414
|
-
type:
|
4414
|
+
type: schema4,
|
4415
4415
|
typeName: ZodFirstPartyTypeKind.ZodPromise,
|
4416
4416
|
...processCreateParams(params)
|
4417
4417
|
});
|
@@ -4536,17 +4536,17 @@ var ZodEffects = class extends ZodType {
|
|
4536
4536
|
util.assertNever(effect);
|
4537
4537
|
}
|
4538
4538
|
};
|
4539
|
-
ZodEffects.create = (
|
4539
|
+
ZodEffects.create = (schema4, effect, params) => {
|
4540
4540
|
return new ZodEffects({
|
4541
|
-
schema:
|
4541
|
+
schema: schema4,
|
4542
4542
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
4543
4543
|
effect,
|
4544
4544
|
...processCreateParams(params)
|
4545
4545
|
});
|
4546
4546
|
};
|
4547
|
-
ZodEffects.createWithPreprocess = (preprocess,
|
4547
|
+
ZodEffects.createWithPreprocess = (preprocess, schema4, params) => {
|
4548
4548
|
return new ZodEffects({
|
4549
|
-
schema:
|
4549
|
+
schema: schema4,
|
4550
4550
|
effect: { type: "preprocess", transform: preprocess },
|
4551
4551
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
4552
4552
|
...processCreateParams(params)
|
@@ -5520,8 +5520,117 @@ var dryPg = pgSchema.parse({
|
|
5520
5520
|
}
|
5521
5521
|
});
|
5522
5522
|
|
5523
|
-
// src/serializer/
|
5523
|
+
// src/serializer/singlestoreSchema.ts
|
5524
5524
|
var index3 = objectType({
|
5525
|
+
name: stringType(),
|
5526
|
+
columns: stringType().array(),
|
5527
|
+
isUnique: booleanType(),
|
5528
|
+
using: enumType(["btree", "hash"]).optional(),
|
5529
|
+
algorithm: enumType(["default", "inplace", "copy"]).optional(),
|
5530
|
+
lock: enumType(["default", "none", "shared", "exclusive"]).optional()
|
5531
|
+
}).strict();
|
5532
|
+
var column3 = objectType({
|
5533
|
+
name: stringType(),
|
5534
|
+
type: stringType(),
|
5535
|
+
primaryKey: booleanType(),
|
5536
|
+
notNull: booleanType(),
|
5537
|
+
autoincrement: booleanType().optional(),
|
5538
|
+
default: anyType().optional(),
|
5539
|
+
onUpdate: anyType().optional(),
|
5540
|
+
generated: objectType({
|
5541
|
+
type: enumType(["stored", "virtual"]),
|
5542
|
+
as: stringType()
|
5543
|
+
}).optional()
|
5544
|
+
}).strict();
|
5545
|
+
var compositePK3 = objectType({
|
5546
|
+
name: stringType(),
|
5547
|
+
columns: stringType().array()
|
5548
|
+
}).strict();
|
5549
|
+
var uniqueConstraint3 = objectType({
|
5550
|
+
name: stringType(),
|
5551
|
+
columns: stringType().array()
|
5552
|
+
}).strict();
|
5553
|
+
var table3 = objectType({
|
5554
|
+
name: stringType(),
|
5555
|
+
columns: recordType(stringType(), column3),
|
5556
|
+
indexes: recordType(stringType(), index3),
|
5557
|
+
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
5558
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
5559
|
+
}).strict();
|
5560
|
+
var viewMeta2 = objectType({
|
5561
|
+
algorithm: enumType(["undefined", "merge", "temptable"]),
|
5562
|
+
sqlSecurity: enumType(["definer", "invoker"]),
|
5563
|
+
withCheckOption: enumType(["local", "cascaded"]).optional()
|
5564
|
+
}).strict();
|
5565
|
+
var kitInternals3 = objectType({
|
5566
|
+
tables: recordType(
|
5567
|
+
stringType(),
|
5568
|
+
objectType({
|
5569
|
+
columns: recordType(
|
5570
|
+
stringType(),
|
5571
|
+
objectType({ isDefaultAnExpression: booleanType().optional() }).optional()
|
5572
|
+
)
|
5573
|
+
}).optional()
|
5574
|
+
).optional(),
|
5575
|
+
indexes: recordType(
|
5576
|
+
stringType(),
|
5577
|
+
objectType({
|
5578
|
+
columns: recordType(
|
5579
|
+
stringType(),
|
5580
|
+
objectType({ isExpression: booleanType().optional() }).optional()
|
5581
|
+
)
|
5582
|
+
}).optional()
|
5583
|
+
).optional()
|
5584
|
+
}).optional();
|
5585
|
+
var dialect2 = literalType("singlestore");
|
5586
|
+
var schemaHash3 = objectType({
|
5587
|
+
id: stringType(),
|
5588
|
+
prevId: stringType()
|
5589
|
+
});
|
5590
|
+
var schemaInternal2 = objectType({
|
5591
|
+
version: literalType("1"),
|
5592
|
+
dialect: dialect2,
|
5593
|
+
tables: recordType(stringType(), table3),
|
5594
|
+
/* views: record(string(), view).default({}), */
|
5595
|
+
_meta: objectType({
|
5596
|
+
tables: recordType(stringType(), stringType()),
|
5597
|
+
columns: recordType(stringType(), stringType())
|
5598
|
+
}),
|
5599
|
+
internal: kitInternals3
|
5600
|
+
}).strict();
|
5601
|
+
var schema2 = schemaInternal2.merge(schemaHash3);
|
5602
|
+
var tableSquashed3 = objectType({
|
5603
|
+
name: stringType(),
|
5604
|
+
columns: recordType(stringType(), column3),
|
5605
|
+
indexes: recordType(stringType(), stringType()),
|
5606
|
+
compositePrimaryKeys: recordType(stringType(), stringType()),
|
5607
|
+
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
5608
|
+
}).strict();
|
5609
|
+
var schemaSquashed2 = objectType({
|
5610
|
+
version: literalType("1"),
|
5611
|
+
dialect: dialect2,
|
5612
|
+
tables: recordType(stringType(), tableSquashed3)
|
5613
|
+
/* views: record(string(), viewSquashed), */
|
5614
|
+
}).strict();
|
5615
|
+
var singlestoreSchema = schema2;
|
5616
|
+
var backwardCompatibleSingleStoreSchema = unionType([singlestoreSchema, schema2]);
|
5617
|
+
var drySingleStore = singlestoreSchema.parse({
|
5618
|
+
version: "1",
|
5619
|
+
dialect: "singlestore",
|
5620
|
+
id: originUUID,
|
5621
|
+
prevId: "",
|
5622
|
+
tables: {},
|
5623
|
+
schemas: {},
|
5624
|
+
/* views: {}, */
|
5625
|
+
_meta: {
|
5626
|
+
schemas: {},
|
5627
|
+
tables: {},
|
5628
|
+
columns: {}
|
5629
|
+
}
|
5630
|
+
});
|
5631
|
+
|
5632
|
+
// src/serializer/sqliteSchema.ts
|
5633
|
+
var index4 = objectType({
|
5525
5634
|
name: stringType(),
|
5526
5635
|
columns: stringType().array(),
|
5527
5636
|
where: stringType().optional(),
|
@@ -5536,11 +5645,11 @@ var fk3 = objectType({
|
|
5536
5645
|
onUpdate: stringType().optional(),
|
5537
5646
|
onDelete: stringType().optional()
|
5538
5647
|
}).strict();
|
5539
|
-
var
|
5648
|
+
var compositePK4 = objectType({
|
5540
5649
|
columns: stringType().array(),
|
5541
5650
|
name: stringType().optional()
|
5542
5651
|
}).strict();
|
5543
|
-
var
|
5652
|
+
var column4 = objectType({
|
5544
5653
|
name: stringType(),
|
5545
5654
|
type: stringType(),
|
5546
5655
|
primaryKey: booleanType(),
|
@@ -5554,11 +5663,11 @@ var column3 = objectType({
|
|
5554
5663
|
}).strict();
|
5555
5664
|
var tableV33 = objectType({
|
5556
5665
|
name: stringType(),
|
5557
|
-
columns: recordType(stringType(),
|
5558
|
-
indexes: recordType(stringType(),
|
5666
|
+
columns: recordType(stringType(), column4),
|
5667
|
+
indexes: recordType(stringType(), index4),
|
5559
5668
|
foreignKeys: recordType(stringType(), fk3)
|
5560
5669
|
}).strict();
|
5561
|
-
var
|
5670
|
+
var uniqueConstraint4 = objectType({
|
5562
5671
|
name: stringType(),
|
5563
5672
|
columns: stringType().array()
|
5564
5673
|
}).strict();
|
@@ -5566,50 +5675,50 @@ var checkConstraint3 = objectType({
|
|
5566
5675
|
name: stringType(),
|
5567
5676
|
value: stringType()
|
5568
5677
|
}).strict();
|
5569
|
-
var
|
5678
|
+
var table4 = objectType({
|
5570
5679
|
name: stringType(),
|
5571
|
-
columns: recordType(stringType(),
|
5572
|
-
indexes: recordType(stringType(),
|
5680
|
+
columns: recordType(stringType(), column4),
|
5681
|
+
indexes: recordType(stringType(), index4),
|
5573
5682
|
foreignKeys: recordType(stringType(), fk3),
|
5574
|
-
compositePrimaryKeys: recordType(stringType(),
|
5575
|
-
uniqueConstraints: recordType(stringType(),
|
5683
|
+
compositePrimaryKeys: recordType(stringType(), compositePK4),
|
5684
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint4).default({}),
|
5576
5685
|
checkConstraints: recordType(stringType(), checkConstraint3).default({})
|
5577
5686
|
}).strict();
|
5578
5687
|
var view3 = objectType({
|
5579
5688
|
name: stringType(),
|
5580
|
-
columns: recordType(stringType(),
|
5689
|
+
columns: recordType(stringType(), column4),
|
5581
5690
|
definition: stringType().optional(),
|
5582
5691
|
isExisting: booleanType()
|
5583
5692
|
}).strict();
|
5584
|
-
var
|
5585
|
-
var
|
5693
|
+
var dialect3 = enumType(["sqlite"]);
|
5694
|
+
var schemaHash4 = objectType({
|
5586
5695
|
id: stringType(),
|
5587
5696
|
prevId: stringType()
|
5588
5697
|
}).strict();
|
5589
5698
|
var schemaInternalV32 = objectType({
|
5590
5699
|
version: literalType("3"),
|
5591
|
-
dialect:
|
5700
|
+
dialect: dialect3,
|
5592
5701
|
tables: recordType(stringType(), tableV33),
|
5593
5702
|
enums: objectType({})
|
5594
5703
|
}).strict();
|
5595
5704
|
var schemaInternalV42 = objectType({
|
5596
5705
|
version: literalType("4"),
|
5597
|
-
dialect:
|
5598
|
-
tables: recordType(stringType(),
|
5706
|
+
dialect: dialect3,
|
5707
|
+
tables: recordType(stringType(), table4),
|
5599
5708
|
views: recordType(stringType(), view3).default({}),
|
5600
5709
|
enums: objectType({})
|
5601
5710
|
}).strict();
|
5602
5711
|
var schemaInternalV52 = objectType({
|
5603
5712
|
version: literalType("5"),
|
5604
|
-
dialect:
|
5605
|
-
tables: recordType(stringType(),
|
5713
|
+
dialect: dialect3,
|
5714
|
+
tables: recordType(stringType(), table4),
|
5606
5715
|
enums: objectType({}),
|
5607
5716
|
_meta: objectType({
|
5608
5717
|
tables: recordType(stringType(), stringType()),
|
5609
5718
|
columns: recordType(stringType(), stringType())
|
5610
5719
|
})
|
5611
5720
|
}).strict();
|
5612
|
-
var
|
5721
|
+
var kitInternals4 = objectType({
|
5613
5722
|
indexes: recordType(
|
5614
5723
|
stringType(),
|
5615
5724
|
objectType({
|
@@ -5621,39 +5730,39 @@ var kitInternals3 = objectType({
|
|
5621
5730
|
).optional()
|
5622
5731
|
}).optional();
|
5623
5732
|
var latestVersion = literalType("6");
|
5624
|
-
var
|
5733
|
+
var schemaInternal3 = objectType({
|
5625
5734
|
version: latestVersion,
|
5626
|
-
dialect:
|
5627
|
-
tables: recordType(stringType(),
|
5735
|
+
dialect: dialect3,
|
5736
|
+
tables: recordType(stringType(), table4),
|
5628
5737
|
views: recordType(stringType(), view3).default({}),
|
5629
5738
|
enums: objectType({}),
|
5630
5739
|
_meta: objectType({
|
5631
5740
|
tables: recordType(stringType(), stringType()),
|
5632
5741
|
columns: recordType(stringType(), stringType())
|
5633
5742
|
}),
|
5634
|
-
internal:
|
5743
|
+
internal: kitInternals4
|
5635
5744
|
}).strict();
|
5636
|
-
var schemaV32 = schemaInternalV32.merge(
|
5637
|
-
var schemaV42 = schemaInternalV42.merge(
|
5638
|
-
var schemaV52 = schemaInternalV52.merge(
|
5639
|
-
var
|
5640
|
-
var
|
5745
|
+
var schemaV32 = schemaInternalV32.merge(schemaHash4).strict();
|
5746
|
+
var schemaV42 = schemaInternalV42.merge(schemaHash4).strict();
|
5747
|
+
var schemaV52 = schemaInternalV52.merge(schemaHash4).strict();
|
5748
|
+
var schema3 = schemaInternal3.merge(schemaHash4).strict();
|
5749
|
+
var tableSquashed4 = objectType({
|
5641
5750
|
name: stringType(),
|
5642
|
-
columns: recordType(stringType(),
|
5751
|
+
columns: recordType(stringType(), column4),
|
5643
5752
|
indexes: recordType(stringType(), stringType()),
|
5644
5753
|
foreignKeys: recordType(stringType(), stringType()),
|
5645
5754
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
5646
5755
|
uniqueConstraints: recordType(stringType(), stringType()).default({}),
|
5647
5756
|
checkConstraints: recordType(stringType(), stringType()).default({})
|
5648
5757
|
}).strict();
|
5649
|
-
var
|
5758
|
+
var schemaSquashed3 = objectType({
|
5650
5759
|
version: latestVersion,
|
5651
|
-
dialect:
|
5652
|
-
tables: recordType(stringType(),
|
5760
|
+
dialect: dialect3,
|
5761
|
+
tables: recordType(stringType(), tableSquashed4),
|
5653
5762
|
views: recordType(stringType(), view3),
|
5654
5763
|
enums: anyType()
|
5655
5764
|
}).strict();
|
5656
|
-
var drySQLite =
|
5765
|
+
var drySQLite = schema3.parse({
|
5657
5766
|
version: "6",
|
5658
5767
|
dialect: "sqlite",
|
5659
5768
|
id: originUUID,
|
@@ -5667,7 +5776,7 @@ var drySQLite = schema2.parse({
|
|
5667
5776
|
}
|
5668
5777
|
});
|
5669
5778
|
var sqliteSchemaV5 = schemaV52;
|
5670
|
-
var backwardCompatibleSqliteSchema = unionType([sqliteSchemaV5,
|
5779
|
+
var backwardCompatibleSqliteSchema = unionType([sqliteSchemaV5, schema3]);
|
5671
5780
|
|
5672
5781
|
// src/utils.ts
|
5673
5782
|
var copy = (it) => {
|
@@ -5691,27 +5800,27 @@ var assertV1OutFolder = (out) => {
|
|
5691
5800
|
process.exit(1);
|
5692
5801
|
}
|
5693
5802
|
};
|
5694
|
-
var dryJournal = (
|
5803
|
+
var dryJournal = (dialect4) => {
|
5695
5804
|
return {
|
5696
5805
|
version: snapshotVersion,
|
5697
|
-
dialect:
|
5806
|
+
dialect: dialect4,
|
5698
5807
|
entries: []
|
5699
5808
|
};
|
5700
5809
|
};
|
5701
|
-
var prepareOutFolder = (out,
|
5810
|
+
var prepareOutFolder = (out, dialect4) => {
|
5702
5811
|
const meta = (0, import_path.join)(out, "meta");
|
5703
5812
|
const journalPath = (0, import_path.join)(meta, "_journal.json");
|
5704
5813
|
if (!(0, import_fs.existsSync)((0, import_path.join)(out, "meta"))) {
|
5705
5814
|
(0, import_fs.mkdirSync)(meta, { recursive: true });
|
5706
|
-
(0, import_fs.writeFileSync)(journalPath, JSON.stringify(dryJournal(
|
5815
|
+
(0, import_fs.writeFileSync)(journalPath, JSON.stringify(dryJournal(dialect4)));
|
5707
5816
|
}
|
5708
5817
|
const journal = JSON.parse((0, import_fs.readFileSync)(journalPath).toString());
|
5709
5818
|
const snapshots = (0, import_fs.readdirSync)(meta).filter((it) => !it.startsWith("_")).map((it) => (0, import_path.join)(meta, it));
|
5710
5819
|
snapshots.sort();
|
5711
5820
|
return { meta, snapshots, journal };
|
5712
5821
|
};
|
5713
|
-
var validatorForDialect = (
|
5714
|
-
switch (
|
5822
|
+
var validatorForDialect = (dialect4) => {
|
5823
|
+
switch (dialect4) {
|
5715
5824
|
case "postgresql":
|
5716
5825
|
return { validator: backwardCompatiblePgSchema, version: 7 };
|
5717
5826
|
case "sqlite":
|
@@ -5720,10 +5829,12 @@ var validatorForDialect = (dialect3) => {
|
|
5720
5829
|
return { validator: backwardCompatibleSqliteSchema, version: 6 };
|
5721
5830
|
case "mysql":
|
5722
5831
|
return { validator: backwardCompatibleMysqlSchema, version: 5 };
|
5832
|
+
case "singlestore":
|
5833
|
+
return { validator: backwardCompatibleSingleStoreSchema, version: 1 };
|
5723
5834
|
}
|
5724
5835
|
};
|
5725
|
-
var validateWithReport = (snapshots,
|
5726
|
-
const { validator, version } = validatorForDialect(
|
5836
|
+
var validateWithReport = (snapshots, dialect4) => {
|
5837
|
+
const { validator, version } = validatorForDialect(dialect4);
|
5727
5838
|
const result = snapshots.reduce(
|
5728
5839
|
(accum, it) => {
|
5729
5840
|
const raw = JSON.parse((0, import_fs.readFileSync)(`./${it}`).toString());
|
@@ -5764,9 +5875,9 @@ var validateWithReport = (snapshots, dialect3) => {
|
|
5764
5875
|
);
|
5765
5876
|
return result;
|
5766
5877
|
};
|
5767
|
-
var prepareMigrationFolder = (outFolder = "drizzle",
|
5768
|
-
const { snapshots, journal } = prepareOutFolder(outFolder,
|
5769
|
-
const report = validateWithReport(snapshots,
|
5878
|
+
var prepareMigrationFolder = (outFolder = "drizzle", dialect4) => {
|
5879
|
+
const { snapshots, journal } = prepareOutFolder(outFolder, dialect4);
|
5880
|
+
const report = validateWithReport(snapshots, dialect4);
|
5770
5881
|
if (report.nonLatest.length > 0) {
|
5771
5882
|
console.log(
|
5772
5883
|
report.nonLatest.map((it) => {
|
@@ -5829,8 +5940,8 @@ var tableRenameKey = (it) => {
|
|
5829
5940
|
const out = it.schema ? `"${it.schema}"."${it.name}"` : `"${it.name}"`;
|
5830
5941
|
return out;
|
5831
5942
|
};
|
5832
|
-
var columnRenameKey = (
|
5833
|
-
const out =
|
5943
|
+
var columnRenameKey = (table5, schema4, column5) => {
|
5944
|
+
const out = schema4 ? `"${schema4}"."${table5}"."${column5}"` : `"${table5}"."${column5}"`;
|
5834
5945
|
return out;
|
5835
5946
|
};
|
5836
5947
|
var kloudMeta = () => {
|