drizzle-kit 0.21.2-4691a9f → 0.21.2-9c89270
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +24463 -18324
- package/index.d.mts +9 -1
- package/index.d.ts +9 -1
- package/package.json +4 -3
- package/payload.d.mts +10 -96
- package/payload.d.ts +10 -96
- package/payload.js +1218 -1660
- package/payload.mjs +1218 -1660
- package/utils-studio.js +46 -182
- package/utils-studio.mjs +46 -182
- package/utils.js +8 -90
- package/utils.mjs +8 -90
package/utils-studio.mjs
CHANGED
@@ -570,7 +570,7 @@ var init_global = __esm({
|
|
570
570
|
"src/global.ts"() {
|
571
571
|
"use strict";
|
572
572
|
originUUID = "00000000-0000-0000-0000-000000000000";
|
573
|
-
snapshotVersion = "
|
573
|
+
snapshotVersion = "6";
|
574
574
|
}
|
575
575
|
});
|
576
576
|
|
@@ -4499,7 +4499,7 @@ var init_mysqlSchema = __esm({
|
|
4499
4499
|
});
|
4500
4500
|
|
4501
4501
|
// src/serializer/pgSchema.ts
|
4502
|
-
var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1,
|
4502
|
+
var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, index2, fk2, column2, tableV32, compositePK2, uniqueConstraint2, tableV42, table2, schemaHash2, kitInternals2, pgSchemaInternalV3, pgSchemaInternalV4, pgSchemaInternalV5, pgSchemaExternal, pgSchemaInternal, tableSquashed2, tableSquashedV42, pgSchemaSquashedV4, pgSchemaSquashed, pgSchemaV3, pgSchemaV4, pgSchemaV5, pgSchema2, backwardCompatiblePgSchema, dryPg;
|
4503
4503
|
var init_pgSchema = __esm({
|
4504
4504
|
"src/serializer/pgSchema.ts"() {
|
4505
4505
|
"use strict";
|
@@ -4567,48 +4567,10 @@ var init_pgSchema = __esm({
|
|
4567
4567
|
tables: recordType(stringType(), tableV1),
|
4568
4568
|
enums: recordType(stringType(), enumSchemaV1)
|
4569
4569
|
}).strict();
|
4570
|
-
indexColumn = objectType({
|
4571
|
-
expression: stringType(),
|
4572
|
-
isExpression: booleanType(),
|
4573
|
-
asc: booleanType(),
|
4574
|
-
nulls: stringType().optional(),
|
4575
|
-
opclass: stringType().optional()
|
4576
|
-
});
|
4577
4570
|
index2 = objectType({
|
4578
|
-
name: stringType(),
|
4579
|
-
columns: indexColumn.array(),
|
4580
|
-
isUnique: booleanType(),
|
4581
|
-
with: recordType(stringType(), anyType()).optional(),
|
4582
|
-
method: stringType().default("btree"),
|
4583
|
-
where: stringType().optional(),
|
4584
|
-
concurrently: booleanType().default(false)
|
4585
|
-
}).strict();
|
4586
|
-
indexV4 = objectType({
|
4587
|
-
name: stringType(),
|
4588
|
-
columns: stringType().array(),
|
4589
|
-
isUnique: booleanType(),
|
4590
|
-
with: recordType(stringType(), stringType()).optional(),
|
4591
|
-
method: stringType().default("btree"),
|
4592
|
-
where: stringType().optional(),
|
4593
|
-
concurrently: booleanType().default(false)
|
4594
|
-
}).strict();
|
4595
|
-
indexV5 = objectType({
|
4596
4571
|
name: stringType(),
|
4597
4572
|
columns: stringType().array(),
|
4598
|
-
isUnique: booleanType()
|
4599
|
-
with: recordType(stringType(), stringType()).optional(),
|
4600
|
-
method: stringType().default("btree"),
|
4601
|
-
where: stringType().optional(),
|
4602
|
-
concurrently: booleanType().default(false)
|
4603
|
-
}).strict();
|
4604
|
-
indexV6 = objectType({
|
4605
|
-
name: stringType(),
|
4606
|
-
columns: stringType().array(),
|
4607
|
-
isUnique: booleanType(),
|
4608
|
-
with: recordType(stringType(), stringType()).optional(),
|
4609
|
-
method: stringType().default("btree"),
|
4610
|
-
where: stringType().optional(),
|
4611
|
-
concurrently: booleanType().default(false)
|
4573
|
+
isUnique: booleanType()
|
4612
4574
|
}).strict();
|
4613
4575
|
fk2 = objectType({
|
4614
4576
|
name: stringType(),
|
@@ -4650,27 +4612,9 @@ var init_pgSchema = __esm({
|
|
4650
4612
|
name: stringType(),
|
4651
4613
|
schema: stringType(),
|
4652
4614
|
columns: recordType(stringType(), column2),
|
4653
|
-
indexes: recordType(stringType(),
|
4615
|
+
indexes: recordType(stringType(), index2),
|
4654
4616
|
foreignKeys: recordType(stringType(), fk2)
|
4655
4617
|
}).strict();
|
4656
|
-
tableV6 = objectType({
|
4657
|
-
name: stringType(),
|
4658
|
-
schema: stringType(),
|
4659
|
-
columns: recordType(stringType(), column2),
|
4660
|
-
indexes: recordType(stringType(), indexV6),
|
4661
|
-
foreignKeys: recordType(stringType(), fk2),
|
4662
|
-
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
4663
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
4664
|
-
}).strict();
|
4665
|
-
tableV5 = objectType({
|
4666
|
-
name: stringType(),
|
4667
|
-
schema: stringType(),
|
4668
|
-
columns: recordType(stringType(), column2),
|
4669
|
-
indexes: recordType(stringType(), indexV5),
|
4670
|
-
foreignKeys: recordType(stringType(), fk2),
|
4671
|
-
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
4672
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
4673
|
-
}).strict();
|
4674
4618
|
table2 = objectType({
|
4675
4619
|
name: stringType(),
|
4676
4620
|
schema: stringType(),
|
@@ -4715,7 +4659,7 @@ var init_pgSchema = __esm({
|
|
4715
4659
|
pgSchemaInternalV5 = objectType({
|
4716
4660
|
version: literalType("5"),
|
4717
4661
|
dialect: literalType("pg"),
|
4718
|
-
tables: recordType(stringType(),
|
4662
|
+
tables: recordType(stringType(), table2),
|
4719
4663
|
enums: recordType(stringType(), enumSchemaV1),
|
4720
4664
|
schemas: recordType(stringType(), stringType()),
|
4721
4665
|
_meta: objectType({
|
@@ -4725,19 +4669,6 @@ var init_pgSchema = __esm({
|
|
4725
4669
|
}),
|
4726
4670
|
internal: kitInternals2
|
4727
4671
|
}).strict();
|
4728
|
-
pgSchemaInternalV6 = objectType({
|
4729
|
-
version: literalType("6"),
|
4730
|
-
dialect: literalType("postgresql"),
|
4731
|
-
tables: recordType(stringType(), tableV6),
|
4732
|
-
enums: recordType(stringType(), enumSchema),
|
4733
|
-
schemas: recordType(stringType(), stringType()),
|
4734
|
-
_meta: objectType({
|
4735
|
-
schemas: recordType(stringType(), stringType()),
|
4736
|
-
tables: recordType(stringType(), stringType()),
|
4737
|
-
columns: recordType(stringType(), stringType())
|
4738
|
-
}),
|
4739
|
-
internal: kitInternals2
|
4740
|
-
}).strict();
|
4741
4672
|
pgSchemaExternal = objectType({
|
4742
4673
|
version: literalType("5"),
|
4743
4674
|
dialect: literalType("pg"),
|
@@ -4751,7 +4682,7 @@ var init_pgSchema = __esm({
|
|
4751
4682
|
})
|
4752
4683
|
}).strict();
|
4753
4684
|
pgSchemaInternal = objectType({
|
4754
|
-
version: literalType("
|
4685
|
+
version: literalType("6"),
|
4755
4686
|
dialect: literalType("postgresql"),
|
4756
4687
|
tables: recordType(stringType(), table2),
|
4757
4688
|
enums: recordType(stringType(), enumSchema),
|
@@ -4786,15 +4717,8 @@ var init_pgSchema = __esm({
|
|
4786
4717
|
enums: recordType(stringType(), enumSchemaV1),
|
4787
4718
|
schemas: recordType(stringType(), stringType())
|
4788
4719
|
}).strict();
|
4789
|
-
pgSchemaSquashedV6 = objectType({
|
4790
|
-
version: literalType("6"),
|
4791
|
-
dialect: literalType("postgresql"),
|
4792
|
-
tables: recordType(stringType(), tableSquashed2),
|
4793
|
-
enums: recordType(stringType(), enumSchema),
|
4794
|
-
schemas: recordType(stringType(), stringType())
|
4795
|
-
}).strict();
|
4796
4720
|
pgSchemaSquashed = objectType({
|
4797
|
-
version: literalType("
|
4721
|
+
version: literalType("6"),
|
4798
4722
|
dialect: literalType("postgresql"),
|
4799
4723
|
tables: recordType(stringType(), tableSquashed2),
|
4800
4724
|
enums: recordType(stringType(), enumSchema),
|
@@ -4803,13 +4727,8 @@ var init_pgSchema = __esm({
|
|
4803
4727
|
pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
4804
4728
|
pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
4805
4729
|
pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash2);
|
4806
|
-
pgSchemaV6 = pgSchemaInternalV6.merge(schemaHash2);
|
4807
4730
|
pgSchema2 = pgSchemaInternal.merge(schemaHash2);
|
4808
|
-
backwardCompatiblePgSchema = unionType([
|
4809
|
-
pgSchemaV5,
|
4810
|
-
pgSchemaV6,
|
4811
|
-
pgSchema2
|
4812
|
-
]);
|
4731
|
+
backwardCompatiblePgSchema = unionType([pgSchemaV5, pgSchema2]);
|
4813
4732
|
dryPg = pgSchema2.parse({
|
4814
4733
|
version: snapshotVersion,
|
4815
4734
|
dialect: "postgresql",
|
@@ -5052,12 +4971,24 @@ var init_sqliteSerializer = __esm({
|
|
5052
4971
|
`SELECT
|
5053
4972
|
m.name as "tableName", p.name as "columnName", p.type as "columnType", p."notnull" as "notNull", p.dflt_value as "defaultValue", p.pk as pk
|
5054
4973
|
FROM sqlite_master AS m JOIN pragma_table_info(m.name) AS p
|
5055
|
-
WHERE m.type = 'table'
|
4974
|
+
WHERE m.type = 'table'
|
4975
|
+
and m.tbl_name != 'sqlite_sequence'
|
4976
|
+
and m.tbl_name != 'sqlite_stat1'
|
4977
|
+
and m.tbl_name != '_litestream_seq'
|
4978
|
+
and m.tbl_name != '_litestream_lock'
|
4979
|
+
and m.tbl_name != 'libsql_wasm_func_table'
|
4980
|
+
and m.tbl_name != '__drizzle_migrations'
|
4981
|
+
and m.tbl_name != '_cf_KV';
|
5056
4982
|
`
|
5057
4983
|
);
|
5058
4984
|
const tablesWithSeq = [];
|
5059
4985
|
const seq = await db.query(
|
5060
|
-
`SELECT * FROM sqlite_master WHERE name != 'sqlite_sequence'
|
4986
|
+
`SELECT * FROM sqlite_master WHERE name != 'sqlite_sequence'
|
4987
|
+
and name != 'sqlite_stat1'
|
4988
|
+
and name != '_litestream_seq'
|
4989
|
+
and name != '_litestream_lock'
|
4990
|
+
and tbl_name != '_cf_KV'
|
4991
|
+
and sql GLOB '*[ *' || CHAR(9) || CHAR(10) || CHAR(13) || ']AUTOINCREMENT[^'']*';`
|
5061
4992
|
);
|
5062
4993
|
for (const s of seq) {
|
5063
4994
|
tablesWithSeq.push(s.name);
|
@@ -5142,7 +5073,8 @@ var init_sqliteSerializer = __esm({
|
|
5142
5073
|
try {
|
5143
5074
|
const fks = await db.query(
|
5144
5075
|
`SELECT m.name as "tableFrom", f.id as "id", f."table" as "tableTo", f."from", f."to", f."on_update" as "onUpdate", f."on_delete" as "onDelete", f.seq as "seq"
|
5145
|
-
FROM sqlite_master m, pragma_foreign_key_list(m.name) as f
|
5076
|
+
FROM sqlite_master m, pragma_foreign_key_list(m.name) as f
|
5077
|
+
where m.tbl_name != '_cf_KV';`
|
5146
5078
|
);
|
5147
5079
|
const fkByTableName = {};
|
5148
5080
|
for (const fkRow of fks) {
|
@@ -5201,7 +5133,9 @@ FROM sqlite_master AS m,
|
|
5201
5133
|
pragma_index_list(m.name) AS il,
|
5202
5134
|
pragma_index_info(il.name) AS ii
|
5203
5135
|
WHERE
|
5204
|
-
m.type = 'table'
|
5136
|
+
m.type = 'table'
|
5137
|
+
and il.name NOT LIKE 'sqlite_autoindex_%'
|
5138
|
+
and m.tbl_name != '_cf_KV';`
|
5205
5139
|
);
|
5206
5140
|
for (const idxRow of idxs) {
|
5207
5141
|
const tableName = idxRow.tableName;
|
@@ -5454,13 +5388,6 @@ var require_brace_expansion = __commonJS({
|
|
5454
5388
|
}
|
5455
5389
|
});
|
5456
5390
|
|
5457
|
-
// src/extensions/vector.ts
|
5458
|
-
var init_vector = __esm({
|
5459
|
-
"src/extensions/vector.ts"() {
|
5460
|
-
"use strict";
|
5461
|
-
}
|
5462
|
-
});
|
5463
|
-
|
5464
5391
|
// src/serializer/pgSerializer.ts
|
5465
5392
|
import {
|
5466
5393
|
PgDialect,
|
@@ -5475,7 +5402,6 @@ var init_pgSerializer = __esm({
|
|
5475
5402
|
"use strict";
|
5476
5403
|
init_serializer();
|
5477
5404
|
init_outputs();
|
5478
|
-
init_vector();
|
5479
5405
|
dialect4 = new PgDialect();
|
5480
5406
|
trimChar = (str, char) => {
|
5481
5407
|
let start = 0;
|
@@ -5737,10 +5663,7 @@ var init_pgSerializer = __esm({
|
|
5737
5663
|
columnTypeMapped = trimChar(columnTypeMapped, '"');
|
5738
5664
|
columnToReturn[columnName] = {
|
5739
5665
|
name: columnName,
|
5740
|
-
type:
|
5741
|
-
// filter vectors, but in future we should filter any extension that was installed by user
|
5742
|
-
columnAdditionalDT === "USER-DEFINED" && enumType3 !== "vector" ? enumType3 : columnTypeMapped
|
5743
|
-
),
|
5666
|
+
type: columnAdditionalDT === "USER-DEFINED" ? enumType3 : columnTypeMapped,
|
5744
5667
|
typeSchema: enumsToReturn[`${tableSchema}.${enumType3}`] !== void 0 ? enumsToReturn[`${tableSchema}.${enumType3}`].schema : void 0,
|
5745
5668
|
primaryKey: primaryKey.length === 1 && cprimaryKey.length < 2,
|
5746
5669
|
// default: isSerial ? undefined : defaultValue,
|
@@ -5751,42 +5674,15 @@ var init_pgSerializer = __esm({
|
|
5751
5674
|
}
|
5752
5675
|
}
|
5753
5676
|
const dbIndexes = await db.query(
|
5754
|
-
`SELECT
|
5755
|
-
|
5756
|
-
|
5757
|
-
|
5758
|
-
|
5759
|
-
|
5760
|
-
|
5761
|
-
|
5762
|
-
|
5763
|
-
)
|
5764
|
-
|| '}')::text[]
|
5765
|
-
)[k.i]
|
5766
|
-
) AS column_name,
|
5767
|
-
CASE
|
5768
|
-
WHEN pg_get_expr(i.indexprs, i.indrelid) IS NOT NULL THEN 1
|
5769
|
-
ELSE 0
|
5770
|
-
END AS is_expression,
|
5771
|
-
i.indoption[k.i-1] & 1 = 1 AS descending,
|
5772
|
-
i.indoption[k.i-1] & 2 = 2 AS nulls_first,
|
5773
|
-
pg_get_expr(
|
5774
|
-
i.indpred,
|
5775
|
-
i.indrelid
|
5776
|
-
) as where,
|
5777
|
-
opc.opcname
|
5778
|
-
FROM pg_class t
|
5779
|
-
LEFT JOIN pg_index i ON t.oid = i.indrelid
|
5780
|
-
LEFT JOIN pg_class ic ON ic.oid = i.indexrelid
|
5781
|
-
CROSS JOIN LATERAL (SELECT unnest(i.indkey), generate_subscripts(i.indkey, 1) + 1) AS k(attnum, i)
|
5782
|
-
LEFT JOIN pg_attribute AS a
|
5783
|
-
ON i.indrelid = a.attrelid AND k.attnum = a.attnum
|
5784
|
-
JOIN pg_namespace c on c.oid = t.relnamespace
|
5785
|
-
LEFT JOIN pg_am AS am ON ic.relam = am.oid
|
5786
|
-
JOIN pg_opclass opc ON opc.oid = ANY(i.indclass)
|
5787
|
-
WHERE
|
5788
|
-
c.nspname = '${tableSchema}' AND
|
5789
|
-
t.relname = '${tableName}';`
|
5677
|
+
`SELECT t.relname as table_name, i.relname AS index_name, ix.indisunique AS is_unique, a.attname AS column_name
|
5678
|
+
FROM pg_class t
|
5679
|
+
JOIN pg_index ix ON t.oid = ix.indrelid
|
5680
|
+
JOIN pg_class i ON i.oid = ix.indexrelid
|
5681
|
+
JOIN pg_attribute a ON a.attrelid = t.oid AND a.attnum = ANY(ix.indkey)
|
5682
|
+
JOIN pg_namespace ns ON ns.oid = t.relnamespace
|
5683
|
+
WHERE ns.nspname = '${tableSchema}'
|
5684
|
+
AND t.relname = '${tableName}'
|
5685
|
+
and ix.indisprimary = false;`
|
5790
5686
|
);
|
5791
5687
|
const dbIndexFromConstraint = await db.query(
|
5792
5688
|
`SELECT
|
@@ -5803,51 +5699,18 @@ var init_pgSerializer = __esm({
|
|
5803
5699
|
);
|
5804
5700
|
const idxsInConsteraint = dbIndexFromConstraint.filter((it) => it.generated_by_constraint === 1).map((it) => it.index_name);
|
5805
5701
|
for (const dbIndex of dbIndexes) {
|
5806
|
-
const indexName = dbIndex.
|
5702
|
+
const indexName = dbIndex.index_name;
|
5807
5703
|
const indexColumnName = dbIndex.column_name;
|
5808
5704
|
const indexIsUnique = dbIndex.is_unique;
|
5809
|
-
const indexMethod = dbIndex.method;
|
5810
|
-
const indexWith = dbIndex.with;
|
5811
|
-
const indexWhere = dbIndex.where;
|
5812
|
-
const opclass = dbIndex.opcname;
|
5813
|
-
const isExpression = dbIndex.is_expression === 1;
|
5814
|
-
const desc = dbIndex.descending;
|
5815
|
-
const nullsFirst = dbIndex.nulls_first;
|
5816
|
-
const mappedWith = {};
|
5817
|
-
if (indexWith !== null) {
|
5818
|
-
indexWith.forEach((it) => {
|
5819
|
-
const splitted = it.split("=");
|
5820
|
-
mappedWith[splitted[0]] = splitted[1];
|
5821
|
-
});
|
5822
|
-
}
|
5823
5705
|
if (idxsInConsteraint.includes(indexName))
|
5824
5706
|
continue;
|
5825
5707
|
if (typeof indexToReturn[indexName] !== "undefined") {
|
5826
|
-
indexToReturn[indexName].columns.push(
|
5827
|
-
expression: indexColumnName,
|
5828
|
-
asc: !desc,
|
5829
|
-
nulls: nullsFirst ? "first" : "last",
|
5830
|
-
opclass,
|
5831
|
-
isExpression
|
5832
|
-
});
|
5708
|
+
indexToReturn[indexName].columns.push(indexColumnName);
|
5833
5709
|
} else {
|
5834
5710
|
indexToReturn[indexName] = {
|
5835
5711
|
name: indexName,
|
5836
|
-
columns: [
|
5837
|
-
|
5838
|
-
expression: indexColumnName,
|
5839
|
-
asc: !desc,
|
5840
|
-
nulls: nullsFirst ? "first" : "last",
|
5841
|
-
opclass,
|
5842
|
-
isExpression
|
5843
|
-
}
|
5844
|
-
],
|
5845
|
-
isUnique: indexIsUnique,
|
5846
|
-
// should not be a part of diff detecs
|
5847
|
-
concurrently: false,
|
5848
|
-
method: indexMethod,
|
5849
|
-
where: indexWhere === null ? void 0 : indexWhere,
|
5850
|
-
with: mappedWith
|
5712
|
+
columns: [indexColumnName],
|
5713
|
+
isUnique: indexIsUnique
|
5851
5714
|
};
|
5852
5715
|
}
|
5853
5716
|
}
|
@@ -5883,7 +5746,7 @@ var init_pgSerializer = __esm({
|
|
5883
5746
|
}
|
5884
5747
|
const schemasObject = Object.fromEntries([...schemas].map((it) => [it, it]));
|
5885
5748
|
return {
|
5886
|
-
version: "
|
5749
|
+
version: "6",
|
5887
5750
|
dialect: "postgresql",
|
5888
5751
|
tables: result,
|
5889
5752
|
enums: enumsToReturn,
|
@@ -5905,6 +5768,7 @@ var init_pgSerializer = __esm({
|
|
5905
5768
|
"time without time zone": "::time without time zone",
|
5906
5769
|
// "timestamp with time zone": "::timestamp with time zone",
|
5907
5770
|
"timestamp without time zone": "::timestamp without time zone",
|
5771
|
+
"timestamp(": "::timestamp without time zone",
|
5908
5772
|
// date: "::date",
|
5909
5773
|
// interval: "::interval",
|
5910
5774
|
// character: "::bpchar",
|
@@ -5917,15 +5781,15 @@ var init_pgSerializer = __esm({
|
|
5917
5781
|
"character(": "::bpchar"
|
5918
5782
|
};
|
5919
5783
|
defaultForColumn = (column4) => {
|
5784
|
+
if (column4.column_default === null) {
|
5785
|
+
return void 0;
|
5786
|
+
}
|
5920
5787
|
if (column4.data_type === "serial" || column4.data_type === "smallserial" || column4.data_type === "bigserial") {
|
5921
5788
|
return void 0;
|
5922
5789
|
}
|
5923
5790
|
const hasDifferentDefaultCast = Object.keys(columnToDefault).find(
|
5924
5791
|
(it) => column4.data_type.startsWith(it)
|
5925
5792
|
);
|
5926
|
-
if (column4.column_default === null) {
|
5927
|
-
return void 0;
|
5928
|
-
}
|
5929
5793
|
const columnDefaultAsString = column4.column_default.toString();
|
5930
5794
|
if (columnDefaultAsString.endsWith(
|
5931
5795
|
hasDifferentDefaultCast ? columnToDefault[hasDifferentDefaultCast] : column4.data_type
|
package/utils.js
CHANGED
@@ -1077,7 +1077,7 @@ var info = (msg, greyMsg = "") => {
|
|
1077
1077
|
|
1078
1078
|
// src/global.ts
|
1079
1079
|
var originUUID = "00000000-0000-0000-0000-000000000000";
|
1080
|
-
var snapshotVersion = "
|
1080
|
+
var snapshotVersion = "6";
|
1081
1081
|
|
1082
1082
|
// node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
1083
1083
|
var util;
|
@@ -5060,48 +5060,10 @@ var pgSchemaV1 = objectType({
|
|
5060
5060
|
tables: recordType(stringType(), tableV1),
|
5061
5061
|
enums: recordType(stringType(), enumSchemaV1)
|
5062
5062
|
}).strict();
|
5063
|
-
var indexColumn = objectType({
|
5064
|
-
expression: stringType(),
|
5065
|
-
isExpression: booleanType(),
|
5066
|
-
asc: booleanType(),
|
5067
|
-
nulls: stringType().optional(),
|
5068
|
-
opclass: stringType().optional()
|
5069
|
-
});
|
5070
5063
|
var index2 = objectType({
|
5071
|
-
name: stringType(),
|
5072
|
-
columns: indexColumn.array(),
|
5073
|
-
isUnique: booleanType(),
|
5074
|
-
with: recordType(stringType(), anyType()).optional(),
|
5075
|
-
method: stringType().default("btree"),
|
5076
|
-
where: stringType().optional(),
|
5077
|
-
concurrently: booleanType().default(false)
|
5078
|
-
}).strict();
|
5079
|
-
var indexV4 = 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 indexV5 = objectType({
|
5089
5064
|
name: stringType(),
|
5090
5065
|
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)
|
5096
|
-
}).strict();
|
5097
|
-
var indexV6 = objectType({
|
5098
|
-
name: stringType(),
|
5099
|
-
columns: stringType().array(),
|
5100
|
-
isUnique: booleanType(),
|
5101
|
-
with: recordType(stringType(), stringType()).optional(),
|
5102
|
-
method: stringType().default("btree"),
|
5103
|
-
where: stringType().optional(),
|
5104
|
-
concurrently: booleanType().default(false)
|
5066
|
+
isUnique: booleanType()
|
5105
5067
|
}).strict();
|
5106
5068
|
var fk2 = objectType({
|
5107
5069
|
name: stringType(),
|
@@ -5143,27 +5105,9 @@ var tableV42 = objectType({
|
|
5143
5105
|
name: stringType(),
|
5144
5106
|
schema: stringType(),
|
5145
5107
|
columns: recordType(stringType(), column2),
|
5146
|
-
indexes: recordType(stringType(),
|
5108
|
+
indexes: recordType(stringType(), index2),
|
5147
5109
|
foreignKeys: recordType(stringType(), fk2)
|
5148
5110
|
}).strict();
|
5149
|
-
var tableV6 = objectType({
|
5150
|
-
name: stringType(),
|
5151
|
-
schema: stringType(),
|
5152
|
-
columns: recordType(stringType(), column2),
|
5153
|
-
indexes: recordType(stringType(), indexV6),
|
5154
|
-
foreignKeys: recordType(stringType(), fk2),
|
5155
|
-
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
5156
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
5157
|
-
}).strict();
|
5158
|
-
var tableV5 = objectType({
|
5159
|
-
name: stringType(),
|
5160
|
-
schema: stringType(),
|
5161
|
-
columns: recordType(stringType(), column2),
|
5162
|
-
indexes: recordType(stringType(), indexV5),
|
5163
|
-
foreignKeys: recordType(stringType(), fk2),
|
5164
|
-
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
5165
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
5166
|
-
}).strict();
|
5167
5111
|
var table2 = objectType({
|
5168
5112
|
name: stringType(),
|
5169
5113
|
schema: stringType(),
|
@@ -5208,7 +5152,7 @@ var pgSchemaInternalV4 = objectType({
|
|
5208
5152
|
var pgSchemaInternalV5 = objectType({
|
5209
5153
|
version: literalType("5"),
|
5210
5154
|
dialect: literalType("pg"),
|
5211
|
-
tables: recordType(stringType(),
|
5155
|
+
tables: recordType(stringType(), table2),
|
5212
5156
|
enums: recordType(stringType(), enumSchemaV1),
|
5213
5157
|
schemas: recordType(stringType(), stringType()),
|
5214
5158
|
_meta: objectType({
|
@@ -5218,19 +5162,6 @@ var pgSchemaInternalV5 = objectType({
|
|
5218
5162
|
}),
|
5219
5163
|
internal: kitInternals2
|
5220
5164
|
}).strict();
|
5221
|
-
var pgSchemaInternalV6 = objectType({
|
5222
|
-
version: literalType("6"),
|
5223
|
-
dialect: literalType("postgresql"),
|
5224
|
-
tables: recordType(stringType(), tableV6),
|
5225
|
-
enums: recordType(stringType(), enumSchema),
|
5226
|
-
schemas: recordType(stringType(), stringType()),
|
5227
|
-
_meta: objectType({
|
5228
|
-
schemas: recordType(stringType(), stringType()),
|
5229
|
-
tables: recordType(stringType(), stringType()),
|
5230
|
-
columns: recordType(stringType(), stringType())
|
5231
|
-
}),
|
5232
|
-
internal: kitInternals2
|
5233
|
-
}).strict();
|
5234
5165
|
var pgSchemaExternal = objectType({
|
5235
5166
|
version: literalType("5"),
|
5236
5167
|
dialect: literalType("pg"),
|
@@ -5244,7 +5175,7 @@ var pgSchemaExternal = objectType({
|
|
5244
5175
|
})
|
5245
5176
|
}).strict();
|
5246
5177
|
var pgSchemaInternal = objectType({
|
5247
|
-
version: literalType("
|
5178
|
+
version: literalType("6"),
|
5248
5179
|
dialect: literalType("postgresql"),
|
5249
5180
|
tables: recordType(stringType(), table2),
|
5250
5181
|
enums: recordType(stringType(), enumSchema),
|
@@ -5279,15 +5210,8 @@ var pgSchemaSquashedV4 = objectType({
|
|
5279
5210
|
enums: recordType(stringType(), enumSchemaV1),
|
5280
5211
|
schemas: recordType(stringType(), stringType())
|
5281
5212
|
}).strict();
|
5282
|
-
var pgSchemaSquashedV6 = objectType({
|
5283
|
-
version: literalType("6"),
|
5284
|
-
dialect: literalType("postgresql"),
|
5285
|
-
tables: recordType(stringType(), tableSquashed2),
|
5286
|
-
enums: recordType(stringType(), enumSchema),
|
5287
|
-
schemas: recordType(stringType(), stringType())
|
5288
|
-
}).strict();
|
5289
5213
|
var pgSchemaSquashed = objectType({
|
5290
|
-
version: literalType("
|
5214
|
+
version: literalType("6"),
|
5291
5215
|
dialect: literalType("postgresql"),
|
5292
5216
|
tables: recordType(stringType(), tableSquashed2),
|
5293
5217
|
enums: recordType(stringType(), enumSchema),
|
@@ -5296,13 +5220,8 @@ var pgSchemaSquashed = objectType({
|
|
5296
5220
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
5297
5221
|
var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
5298
5222
|
var pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash2);
|
5299
|
-
var pgSchemaV6 = pgSchemaInternalV6.merge(schemaHash2);
|
5300
5223
|
var pgSchema = pgSchemaInternal.merge(schemaHash2);
|
5301
|
-
var backwardCompatiblePgSchema = unionType([
|
5302
|
-
pgSchemaV5,
|
5303
|
-
pgSchemaV6,
|
5304
|
-
pgSchema
|
5305
|
-
]);
|
5224
|
+
var backwardCompatiblePgSchema = unionType([pgSchemaV5, pgSchema]);
|
5306
5225
|
var dryPg = pgSchema.parse({
|
5307
5226
|
version: snapshotVersion,
|
5308
5227
|
dialect: "postgresql",
|
@@ -5480,7 +5399,7 @@ var prepareOutFolder = (out, dialect3) => {
|
|
5480
5399
|
var validatorForDialect = (dialect3) => {
|
5481
5400
|
switch (dialect3) {
|
5482
5401
|
case "postgresql":
|
5483
|
-
return { validator: backwardCompatiblePgSchema, version:
|
5402
|
+
return { validator: backwardCompatiblePgSchema, version: 6 };
|
5484
5403
|
case "sqlite":
|
5485
5404
|
return { validator: backwardCompatibleSqliteSchema, version: 6 };
|
5486
5405
|
case "mysql":
|
@@ -5503,7 +5422,6 @@ var validateWithReport = (snapshots, dialect3) => {
|
|
5503
5422
|
}
|
5504
5423
|
const result2 = validator.safeParse(raw);
|
5505
5424
|
if (!result2.success) {
|
5506
|
-
console.error(result2.error);
|
5507
5425
|
accum.malformed.push(it);
|
5508
5426
|
return accum;
|
5509
5427
|
}
|