drizzle-kit 1.0.0-beta.3-702eadc → 1.0.0-beta.4-4605abe
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-mysql.js +2 -2
- package/api-mysql.mjs +2 -2
- package/api-postgres.js +111 -58
- package/api-postgres.mjs +111 -58
- package/api-sqlite.js +2 -2
- package/api-sqlite.mjs +2 -2
- package/bin.cjs +205 -133
- package/package.json +1 -1
package/api-mysql.js
CHANGED
|
@@ -17373,7 +17373,7 @@ var init_common3 = __esm({
|
|
|
17373
17373
|
configCommonSchema = objectType({
|
|
17374
17374
|
dialect: dialect3,
|
|
17375
17375
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
17376
|
-
out: stringType().
|
|
17376
|
+
out: stringType().default("drizzle"),
|
|
17377
17377
|
breakpoints: booleanType().optional().default(true),
|
|
17378
17378
|
verbose: booleanType().optional().default(false),
|
|
17379
17379
|
driver: driver.optional(),
|
|
@@ -19540,7 +19540,7 @@ var init_snapshot6 = __esm({
|
|
|
19540
19540
|
}).strict();
|
|
19541
19541
|
compositePK5 = objectType({
|
|
19542
19542
|
columns: stringType().array(),
|
|
19543
|
-
name: stringType()
|
|
19543
|
+
name: stringType().optional()
|
|
19544
19544
|
}).strict();
|
|
19545
19545
|
column5 = objectType({
|
|
19546
19546
|
name: stringType(),
|
package/api-mysql.mjs
CHANGED
|
@@ -17385,7 +17385,7 @@ var init_common3 = __esm({
|
|
|
17385
17385
|
configCommonSchema = objectType({
|
|
17386
17386
|
dialect: dialect3,
|
|
17387
17387
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
17388
|
-
out: stringType().
|
|
17388
|
+
out: stringType().default("drizzle"),
|
|
17389
17389
|
breakpoints: booleanType().optional().default(true),
|
|
17390
17390
|
verbose: booleanType().optional().default(false),
|
|
17391
17391
|
driver: driver.optional(),
|
|
@@ -19552,7 +19552,7 @@ var init_snapshot6 = __esm({
|
|
|
19552
19552
|
}).strict();
|
|
19553
19553
|
compositePK5 = objectType({
|
|
19554
19554
|
columns: stringType().array(),
|
|
19555
|
-
name: stringType()
|
|
19555
|
+
name: stringType().optional()
|
|
19556
19556
|
}).strict();
|
|
19557
19557
|
column5 = objectType({
|
|
19558
19558
|
name: stringType(),
|
package/api-postgres.js
CHANGED
|
@@ -15257,7 +15257,7 @@ var init_common3 = __esm({
|
|
|
15257
15257
|
configCommonSchema = objectType({
|
|
15258
15258
|
dialect,
|
|
15259
15259
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
15260
|
-
out: stringType().
|
|
15260
|
+
out: stringType().default("drizzle"),
|
|
15261
15261
|
breakpoints: booleanType().optional().default(true),
|
|
15262
15262
|
verbose: booleanType().optional().default(false),
|
|
15263
15263
|
driver: driver.optional(),
|
|
@@ -21525,7 +21525,7 @@ var init_snapshot6 = __esm({
|
|
|
21525
21525
|
}).strict();
|
|
21526
21526
|
compositePK5 = objectType({
|
|
21527
21527
|
columns: stringType().array(),
|
|
21528
|
-
name: stringType()
|
|
21528
|
+
name: stringType().optional()
|
|
21529
21529
|
}).strict();
|
|
21530
21530
|
column5 = objectType({
|
|
21531
21531
|
name: stringType(),
|
|
@@ -153095,21 +153095,25 @@ var upToV8 = (it) => {
|
|
|
153095
153095
|
for (const schema5 of Object.values(json.schemas)) {
|
|
153096
153096
|
ddl7.schemas.push({ name: schema5 });
|
|
153097
153097
|
}
|
|
153098
|
-
|
|
153099
|
-
|
|
153100
|
-
|
|
153101
|
-
|
|
153102
|
-
|
|
153103
|
-
|
|
153104
|
-
|
|
153105
|
-
|
|
153106
|
-
|
|
153107
|
-
|
|
153108
|
-
|
|
153098
|
+
if (json.sequences) {
|
|
153099
|
+
for (const seq of Object.values(json.sequences)) {
|
|
153100
|
+
ddl7.sequences.push({
|
|
153101
|
+
schema: seq.schema,
|
|
153102
|
+
name: seq.name,
|
|
153103
|
+
startWith: seq.startWith ?? null,
|
|
153104
|
+
incrementBy: seq.increment ?? null,
|
|
153105
|
+
minValue: seq.minValue ?? null,
|
|
153106
|
+
maxValue: seq.maxValue ?? null,
|
|
153107
|
+
cacheSize: seq.cache ? Number(seq.cache) : null,
|
|
153108
|
+
cycle: seq.cycle ?? null
|
|
153109
|
+
});
|
|
153110
|
+
}
|
|
153109
153111
|
}
|
|
153110
153112
|
for (const table6 of Object.values(json.tables)) {
|
|
153111
153113
|
const schema5 = table6.schema || "public";
|
|
153112
|
-
const isRlsEnabled = table6.isRLSEnabled || Object.keys(table6.policies).length > 0 || Object.values(json.policies).some(
|
|
153114
|
+
const isRlsEnabled = table6.isRLSEnabled || Object.keys(table6.policies).length > 0 || Object.values(json.policies).some(
|
|
153115
|
+
(it2) => it2.on === table6.name && (it2.schema ?? "public") === schema5
|
|
153116
|
+
);
|
|
153113
153117
|
ddl7.tables.push({
|
|
153114
153118
|
schema: schema5,
|
|
153115
153119
|
name: table6.name,
|
|
@@ -153150,33 +153154,41 @@ var upToV8 = (it) => {
|
|
|
153150
153154
|
default: typeof column7.default === "undefined" ? null : trimDefaultValueSuffix(String(column7.default))
|
|
153151
153155
|
});
|
|
153152
153156
|
}
|
|
153153
|
-
|
|
153154
|
-
const
|
|
153155
|
-
|
|
153156
|
-
|
|
153157
|
+
if (table6.compositePrimaryKeys) {
|
|
153158
|
+
for (const pk of Object.values(table6.compositePrimaryKeys)) {
|
|
153159
|
+
const nameExplicit = `${table6.name}_${pk.columns.join("_")}_pk` !== pk.name;
|
|
153160
|
+
if (!nameExplicit) {
|
|
153161
|
+
hints.push(
|
|
153162
|
+
`update pk name: ${pk.name} -> ${defaultNameForPK(table6.name)}`
|
|
153163
|
+
);
|
|
153164
|
+
}
|
|
153165
|
+
ddl7.pks.push({
|
|
153166
|
+
schema: schema5,
|
|
153167
|
+
table: table6.name,
|
|
153168
|
+
name: pk.name,
|
|
153169
|
+
columns: pk.columns,
|
|
153170
|
+
nameExplicit
|
|
153171
|
+
// TODO: ??
|
|
153172
|
+
});
|
|
153157
153173
|
}
|
|
153158
|
-
ddl7.pks.push({
|
|
153159
|
-
schema: schema5,
|
|
153160
|
-
table: table6.name,
|
|
153161
|
-
name: pk.name,
|
|
153162
|
-
columns: pk.columns,
|
|
153163
|
-
nameExplicit
|
|
153164
|
-
// TODO: ??
|
|
153165
|
-
});
|
|
153166
153174
|
}
|
|
153167
|
-
|
|
153168
|
-
const
|
|
153169
|
-
|
|
153170
|
-
|
|
153175
|
+
if (table6.uniqueConstraints) {
|
|
153176
|
+
for (const unique of Object.values(table6.uniqueConstraints)) {
|
|
153177
|
+
const nameExplicit = `${table6.name}_${unique.columns.join("_")}_unique` !== unique.name;
|
|
153178
|
+
if (!nameExplicit) {
|
|
153179
|
+
hints.push(
|
|
153180
|
+
`update unique name: ${unique.name} -> ${defaultNameForUnique(table6.name, ...unique.columns)}`
|
|
153181
|
+
);
|
|
153182
|
+
}
|
|
153183
|
+
ddl7.uniques.push({
|
|
153184
|
+
schema: schema5,
|
|
153185
|
+
table: table6.name,
|
|
153186
|
+
columns: unique.columns,
|
|
153187
|
+
name: unique.name,
|
|
153188
|
+
nameExplicit,
|
|
153189
|
+
nullsNotDistinct: unique.nullsNotDistinct ?? defaults.nullsNotDistinct
|
|
153190
|
+
});
|
|
153171
153191
|
}
|
|
153172
|
-
ddl7.uniques.push({
|
|
153173
|
-
schema: schema5,
|
|
153174
|
-
table: table6.name,
|
|
153175
|
-
columns: unique.columns,
|
|
153176
|
-
name: unique.name,
|
|
153177
|
-
nameExplicit,
|
|
153178
|
-
nullsNotDistinct: unique.nullsNotDistinct ?? defaults.nullsNotDistinct
|
|
153179
|
-
});
|
|
153180
153192
|
}
|
|
153181
153193
|
for (const check of Object.values(table6.checkConstraints)) {
|
|
153182
153194
|
ddl7.checks.push({
|
|
@@ -153202,7 +153214,10 @@ var upToV8 = (it) => {
|
|
|
153202
153214
|
const nameExplicit = columns.some((it2) => it2.isExpression === true) || `${table6.name}_${columns.map((it2) => it2.value).join("_")}_index` !== idx.name;
|
|
153203
153215
|
if (!nameExplicit) {
|
|
153204
153216
|
hints.push(
|
|
153205
|
-
`rename index name: ${idx.name} -> ${defaultNameForIndex(
|
|
153217
|
+
`rename index name: ${idx.name} -> ${defaultNameForIndex(
|
|
153218
|
+
table6.name,
|
|
153219
|
+
idx.columns.map((x6) => x6.expression)
|
|
153220
|
+
)}`
|
|
153206
153221
|
);
|
|
153207
153222
|
}
|
|
153208
153223
|
ddl7.indexes.push({
|
|
@@ -153294,16 +153309,43 @@ var upToV8 = (it) => {
|
|
|
153294
153309
|
autovacuumEnabled: getOrNull(opt, "autovacuumEnabled"),
|
|
153295
153310
|
autovacuumFreezeMaxAge: getOrNull(opt, "autovacuumFreezeMaxAge"),
|
|
153296
153311
|
autovacuumFreezeMinAge: getOrNull(opt, "autovacuumFreezeMinAge"),
|
|
153297
|
-
autovacuumFreezeTableAge: getOrNull(
|
|
153298
|
-
|
|
153299
|
-
|
|
153300
|
-
|
|
153301
|
-
|
|
153302
|
-
|
|
153303
|
-
|
|
153304
|
-
|
|
153312
|
+
autovacuumFreezeTableAge: getOrNull(
|
|
153313
|
+
opt,
|
|
153314
|
+
"autovacuumFreezeTableAge"
|
|
153315
|
+
),
|
|
153316
|
+
autovacuumMultixactFreezeMaxAge: getOrNull(
|
|
153317
|
+
opt,
|
|
153318
|
+
"autovacuumMultixactFreezeMaxAge"
|
|
153319
|
+
),
|
|
153320
|
+
autovacuumMultixactFreezeMinAge: getOrNull(
|
|
153321
|
+
opt,
|
|
153322
|
+
"autovacuumMultixactFreezeMinAge"
|
|
153323
|
+
),
|
|
153324
|
+
autovacuumMultixactFreezeTableAge: getOrNull(
|
|
153325
|
+
opt,
|
|
153326
|
+
"autovacuumMultixactFreezeTableAge"
|
|
153327
|
+
),
|
|
153328
|
+
autovacuumVacuumCostDelay: getOrNull(
|
|
153329
|
+
opt,
|
|
153330
|
+
"autovacuumVacuumCostDelay"
|
|
153331
|
+
),
|
|
153332
|
+
autovacuumVacuumCostLimit: getOrNull(
|
|
153333
|
+
opt,
|
|
153334
|
+
"autovacuumVacuumCostLimit"
|
|
153335
|
+
),
|
|
153336
|
+
autovacuumVacuumScaleFactor: getOrNull(
|
|
153337
|
+
opt,
|
|
153338
|
+
"autovacuumVacuumScaleFactor"
|
|
153339
|
+
),
|
|
153340
|
+
autovacuumVacuumThreshold: getOrNull(
|
|
153341
|
+
opt,
|
|
153342
|
+
"autovacuumVacuumThreshold"
|
|
153343
|
+
),
|
|
153305
153344
|
fillfactor: getOrNull(opt, "fillfactor"),
|
|
153306
|
-
logAutovacuumMinDuration: getOrNull(
|
|
153345
|
+
logAutovacuumMinDuration: getOrNull(
|
|
153346
|
+
opt,
|
|
153347
|
+
"logAutovacuumMinDuration"
|
|
153348
|
+
),
|
|
153307
153349
|
parallelWorkers: getOrNull(opt, "parallelWorkers"),
|
|
153308
153350
|
toastTupleTarget: getOrNull(opt, "toastTupleTarget"),
|
|
153309
153351
|
userCatalogTable: getOrNull(opt, "userCatalogTable"),
|
|
@@ -153345,19 +153387,30 @@ var updateUpToV7 = (it) => {
|
|
|
153345
153387
|
const mappedIndexes = Object.fromEntries(
|
|
153346
153388
|
Object.entries(table6.indexes).map((idx) => {
|
|
153347
153389
|
const { columns, ...rest } = idx[1];
|
|
153348
|
-
const mappedColumns = columns.map(
|
|
153349
|
-
|
|
153350
|
-
|
|
153351
|
-
|
|
153352
|
-
|
|
153353
|
-
|
|
153354
|
-
|
|
153355
|
-
|
|
153356
|
-
|
|
153390
|
+
const mappedColumns = columns.map(
|
|
153391
|
+
(it3) => {
|
|
153392
|
+
return {
|
|
153393
|
+
expression: it3,
|
|
153394
|
+
isExpression: false,
|
|
153395
|
+
asc: true,
|
|
153396
|
+
nulls: "last",
|
|
153397
|
+
opClass: void 0
|
|
153398
|
+
};
|
|
153399
|
+
}
|
|
153400
|
+
);
|
|
153357
153401
|
return [idx[0], { columns: mappedColumns, with: {}, ...rest }];
|
|
153358
153402
|
})
|
|
153359
153403
|
);
|
|
153360
|
-
return [
|
|
153404
|
+
return [
|
|
153405
|
+
it2[0],
|
|
153406
|
+
{
|
|
153407
|
+
...table6,
|
|
153408
|
+
indexes: mappedIndexes,
|
|
153409
|
+
policies: {},
|
|
153410
|
+
isRLSEnabled: false,
|
|
153411
|
+
checkConstraints: {}
|
|
153412
|
+
}
|
|
153413
|
+
];
|
|
153361
153414
|
})
|
|
153362
153415
|
);
|
|
153363
153416
|
return {
|
package/api-postgres.mjs
CHANGED
|
@@ -15263,7 +15263,7 @@ var init_common3 = __esm({
|
|
|
15263
15263
|
configCommonSchema = objectType({
|
|
15264
15264
|
dialect,
|
|
15265
15265
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
15266
|
-
out: stringType().
|
|
15266
|
+
out: stringType().default("drizzle"),
|
|
15267
15267
|
breakpoints: booleanType().optional().default(true),
|
|
15268
15268
|
verbose: booleanType().optional().default(false),
|
|
15269
15269
|
driver: driver.optional(),
|
|
@@ -21531,7 +21531,7 @@ var init_snapshot6 = __esm({
|
|
|
21531
21531
|
}).strict();
|
|
21532
21532
|
compositePK5 = objectType({
|
|
21533
21533
|
columns: stringType().array(),
|
|
21534
|
-
name: stringType()
|
|
21534
|
+
name: stringType().optional()
|
|
21535
21535
|
}).strict();
|
|
21536
21536
|
column5 = objectType({
|
|
21537
21537
|
name: stringType(),
|
|
@@ -153125,21 +153125,25 @@ var upToV8 = (it) => {
|
|
|
153125
153125
|
for (const schema5 of Object.values(json.schemas)) {
|
|
153126
153126
|
ddl7.schemas.push({ name: schema5 });
|
|
153127
153127
|
}
|
|
153128
|
-
|
|
153129
|
-
|
|
153130
|
-
|
|
153131
|
-
|
|
153132
|
-
|
|
153133
|
-
|
|
153134
|
-
|
|
153135
|
-
|
|
153136
|
-
|
|
153137
|
-
|
|
153138
|
-
|
|
153128
|
+
if (json.sequences) {
|
|
153129
|
+
for (const seq of Object.values(json.sequences)) {
|
|
153130
|
+
ddl7.sequences.push({
|
|
153131
|
+
schema: seq.schema,
|
|
153132
|
+
name: seq.name,
|
|
153133
|
+
startWith: seq.startWith ?? null,
|
|
153134
|
+
incrementBy: seq.increment ?? null,
|
|
153135
|
+
minValue: seq.minValue ?? null,
|
|
153136
|
+
maxValue: seq.maxValue ?? null,
|
|
153137
|
+
cacheSize: seq.cache ? Number(seq.cache) : null,
|
|
153138
|
+
cycle: seq.cycle ?? null
|
|
153139
|
+
});
|
|
153140
|
+
}
|
|
153139
153141
|
}
|
|
153140
153142
|
for (const table6 of Object.values(json.tables)) {
|
|
153141
153143
|
const schema5 = table6.schema || "public";
|
|
153142
|
-
const isRlsEnabled = table6.isRLSEnabled || Object.keys(table6.policies).length > 0 || Object.values(json.policies).some(
|
|
153144
|
+
const isRlsEnabled = table6.isRLSEnabled || Object.keys(table6.policies).length > 0 || Object.values(json.policies).some(
|
|
153145
|
+
(it2) => it2.on === table6.name && (it2.schema ?? "public") === schema5
|
|
153146
|
+
);
|
|
153143
153147
|
ddl7.tables.push({
|
|
153144
153148
|
schema: schema5,
|
|
153145
153149
|
name: table6.name,
|
|
@@ -153180,33 +153184,41 @@ var upToV8 = (it) => {
|
|
|
153180
153184
|
default: typeof column7.default === "undefined" ? null : trimDefaultValueSuffix(String(column7.default))
|
|
153181
153185
|
});
|
|
153182
153186
|
}
|
|
153183
|
-
|
|
153184
|
-
const
|
|
153185
|
-
|
|
153186
|
-
|
|
153187
|
+
if (table6.compositePrimaryKeys) {
|
|
153188
|
+
for (const pk of Object.values(table6.compositePrimaryKeys)) {
|
|
153189
|
+
const nameExplicit = `${table6.name}_${pk.columns.join("_")}_pk` !== pk.name;
|
|
153190
|
+
if (!nameExplicit) {
|
|
153191
|
+
hints.push(
|
|
153192
|
+
`update pk name: ${pk.name} -> ${defaultNameForPK(table6.name)}`
|
|
153193
|
+
);
|
|
153194
|
+
}
|
|
153195
|
+
ddl7.pks.push({
|
|
153196
|
+
schema: schema5,
|
|
153197
|
+
table: table6.name,
|
|
153198
|
+
name: pk.name,
|
|
153199
|
+
columns: pk.columns,
|
|
153200
|
+
nameExplicit
|
|
153201
|
+
// TODO: ??
|
|
153202
|
+
});
|
|
153187
153203
|
}
|
|
153188
|
-
ddl7.pks.push({
|
|
153189
|
-
schema: schema5,
|
|
153190
|
-
table: table6.name,
|
|
153191
|
-
name: pk.name,
|
|
153192
|
-
columns: pk.columns,
|
|
153193
|
-
nameExplicit
|
|
153194
|
-
// TODO: ??
|
|
153195
|
-
});
|
|
153196
153204
|
}
|
|
153197
|
-
|
|
153198
|
-
const
|
|
153199
|
-
|
|
153200
|
-
|
|
153205
|
+
if (table6.uniqueConstraints) {
|
|
153206
|
+
for (const unique of Object.values(table6.uniqueConstraints)) {
|
|
153207
|
+
const nameExplicit = `${table6.name}_${unique.columns.join("_")}_unique` !== unique.name;
|
|
153208
|
+
if (!nameExplicit) {
|
|
153209
|
+
hints.push(
|
|
153210
|
+
`update unique name: ${unique.name} -> ${defaultNameForUnique(table6.name, ...unique.columns)}`
|
|
153211
|
+
);
|
|
153212
|
+
}
|
|
153213
|
+
ddl7.uniques.push({
|
|
153214
|
+
schema: schema5,
|
|
153215
|
+
table: table6.name,
|
|
153216
|
+
columns: unique.columns,
|
|
153217
|
+
name: unique.name,
|
|
153218
|
+
nameExplicit,
|
|
153219
|
+
nullsNotDistinct: unique.nullsNotDistinct ?? defaults.nullsNotDistinct
|
|
153220
|
+
});
|
|
153201
153221
|
}
|
|
153202
|
-
ddl7.uniques.push({
|
|
153203
|
-
schema: schema5,
|
|
153204
|
-
table: table6.name,
|
|
153205
|
-
columns: unique.columns,
|
|
153206
|
-
name: unique.name,
|
|
153207
|
-
nameExplicit,
|
|
153208
|
-
nullsNotDistinct: unique.nullsNotDistinct ?? defaults.nullsNotDistinct
|
|
153209
|
-
});
|
|
153210
153222
|
}
|
|
153211
153223
|
for (const check of Object.values(table6.checkConstraints)) {
|
|
153212
153224
|
ddl7.checks.push({
|
|
@@ -153232,7 +153244,10 @@ var upToV8 = (it) => {
|
|
|
153232
153244
|
const nameExplicit = columns.some((it2) => it2.isExpression === true) || `${table6.name}_${columns.map((it2) => it2.value).join("_")}_index` !== idx.name;
|
|
153233
153245
|
if (!nameExplicit) {
|
|
153234
153246
|
hints.push(
|
|
153235
|
-
`rename index name: ${idx.name} -> ${defaultNameForIndex(
|
|
153247
|
+
`rename index name: ${idx.name} -> ${defaultNameForIndex(
|
|
153248
|
+
table6.name,
|
|
153249
|
+
idx.columns.map((x6) => x6.expression)
|
|
153250
|
+
)}`
|
|
153236
153251
|
);
|
|
153237
153252
|
}
|
|
153238
153253
|
ddl7.indexes.push({
|
|
@@ -153324,16 +153339,43 @@ var upToV8 = (it) => {
|
|
|
153324
153339
|
autovacuumEnabled: getOrNull(opt, "autovacuumEnabled"),
|
|
153325
153340
|
autovacuumFreezeMaxAge: getOrNull(opt, "autovacuumFreezeMaxAge"),
|
|
153326
153341
|
autovacuumFreezeMinAge: getOrNull(opt, "autovacuumFreezeMinAge"),
|
|
153327
|
-
autovacuumFreezeTableAge: getOrNull(
|
|
153328
|
-
|
|
153329
|
-
|
|
153330
|
-
|
|
153331
|
-
|
|
153332
|
-
|
|
153333
|
-
|
|
153334
|
-
|
|
153342
|
+
autovacuumFreezeTableAge: getOrNull(
|
|
153343
|
+
opt,
|
|
153344
|
+
"autovacuumFreezeTableAge"
|
|
153345
|
+
),
|
|
153346
|
+
autovacuumMultixactFreezeMaxAge: getOrNull(
|
|
153347
|
+
opt,
|
|
153348
|
+
"autovacuumMultixactFreezeMaxAge"
|
|
153349
|
+
),
|
|
153350
|
+
autovacuumMultixactFreezeMinAge: getOrNull(
|
|
153351
|
+
opt,
|
|
153352
|
+
"autovacuumMultixactFreezeMinAge"
|
|
153353
|
+
),
|
|
153354
|
+
autovacuumMultixactFreezeTableAge: getOrNull(
|
|
153355
|
+
opt,
|
|
153356
|
+
"autovacuumMultixactFreezeTableAge"
|
|
153357
|
+
),
|
|
153358
|
+
autovacuumVacuumCostDelay: getOrNull(
|
|
153359
|
+
opt,
|
|
153360
|
+
"autovacuumVacuumCostDelay"
|
|
153361
|
+
),
|
|
153362
|
+
autovacuumVacuumCostLimit: getOrNull(
|
|
153363
|
+
opt,
|
|
153364
|
+
"autovacuumVacuumCostLimit"
|
|
153365
|
+
),
|
|
153366
|
+
autovacuumVacuumScaleFactor: getOrNull(
|
|
153367
|
+
opt,
|
|
153368
|
+
"autovacuumVacuumScaleFactor"
|
|
153369
|
+
),
|
|
153370
|
+
autovacuumVacuumThreshold: getOrNull(
|
|
153371
|
+
opt,
|
|
153372
|
+
"autovacuumVacuumThreshold"
|
|
153373
|
+
),
|
|
153335
153374
|
fillfactor: getOrNull(opt, "fillfactor"),
|
|
153336
|
-
logAutovacuumMinDuration: getOrNull(
|
|
153375
|
+
logAutovacuumMinDuration: getOrNull(
|
|
153376
|
+
opt,
|
|
153377
|
+
"logAutovacuumMinDuration"
|
|
153378
|
+
),
|
|
153337
153379
|
parallelWorkers: getOrNull(opt, "parallelWorkers"),
|
|
153338
153380
|
toastTupleTarget: getOrNull(opt, "toastTupleTarget"),
|
|
153339
153381
|
userCatalogTable: getOrNull(opt, "userCatalogTable"),
|
|
@@ -153375,19 +153417,30 @@ var updateUpToV7 = (it) => {
|
|
|
153375
153417
|
const mappedIndexes = Object.fromEntries(
|
|
153376
153418
|
Object.entries(table6.indexes).map((idx) => {
|
|
153377
153419
|
const { columns, ...rest } = idx[1];
|
|
153378
|
-
const mappedColumns = columns.map(
|
|
153379
|
-
|
|
153380
|
-
|
|
153381
|
-
|
|
153382
|
-
|
|
153383
|
-
|
|
153384
|
-
|
|
153385
|
-
|
|
153386
|
-
|
|
153420
|
+
const mappedColumns = columns.map(
|
|
153421
|
+
(it3) => {
|
|
153422
|
+
return {
|
|
153423
|
+
expression: it3,
|
|
153424
|
+
isExpression: false,
|
|
153425
|
+
asc: true,
|
|
153426
|
+
nulls: "last",
|
|
153427
|
+
opClass: void 0
|
|
153428
|
+
};
|
|
153429
|
+
}
|
|
153430
|
+
);
|
|
153387
153431
|
return [idx[0], { columns: mappedColumns, with: {}, ...rest }];
|
|
153388
153432
|
})
|
|
153389
153433
|
);
|
|
153390
|
-
return [
|
|
153434
|
+
return [
|
|
153435
|
+
it2[0],
|
|
153436
|
+
{
|
|
153437
|
+
...table6,
|
|
153438
|
+
indexes: mappedIndexes,
|
|
153439
|
+
policies: {},
|
|
153440
|
+
isRLSEnabled: false,
|
|
153441
|
+
checkConstraints: {}
|
|
153442
|
+
}
|
|
153443
|
+
];
|
|
153391
153444
|
})
|
|
153392
153445
|
);
|
|
153393
153446
|
return {
|
package/api-sqlite.js
CHANGED
|
@@ -17373,7 +17373,7 @@ var init_common3 = __esm({
|
|
|
17373
17373
|
configCommonSchema = objectType({
|
|
17374
17374
|
dialect: dialect3,
|
|
17375
17375
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
17376
|
-
out: stringType().
|
|
17376
|
+
out: stringType().default("drizzle"),
|
|
17377
17377
|
breakpoints: booleanType().optional().default(true),
|
|
17378
17378
|
verbose: booleanType().optional().default(false),
|
|
17379
17379
|
driver: driver.optional(),
|
|
@@ -19540,7 +19540,7 @@ var init_snapshot6 = __esm({
|
|
|
19540
19540
|
}).strict();
|
|
19541
19541
|
compositePK5 = objectType({
|
|
19542
19542
|
columns: stringType().array(),
|
|
19543
|
-
name: stringType()
|
|
19543
|
+
name: stringType().optional()
|
|
19544
19544
|
}).strict();
|
|
19545
19545
|
column5 = objectType({
|
|
19546
19546
|
name: stringType(),
|
package/api-sqlite.mjs
CHANGED
|
@@ -17385,7 +17385,7 @@ var init_common3 = __esm({
|
|
|
17385
17385
|
configCommonSchema = objectType({
|
|
17386
17386
|
dialect: dialect3,
|
|
17387
17387
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
17388
|
-
out: stringType().
|
|
17388
|
+
out: stringType().default("drizzle"),
|
|
17389
17389
|
breakpoints: booleanType().optional().default(true),
|
|
17390
17390
|
verbose: booleanType().optional().default(false),
|
|
17391
17391
|
driver: driver.optional(),
|
|
@@ -19552,7 +19552,7 @@ var init_snapshot6 = __esm({
|
|
|
19552
19552
|
}).strict();
|
|
19553
19553
|
compositePK5 = objectType({
|
|
19554
19554
|
columns: stringType().array(),
|
|
19555
|
-
name: stringType()
|
|
19555
|
+
name: stringType().optional()
|
|
19556
19556
|
}).strict();
|
|
19557
19557
|
column5 = objectType({
|
|
19558
19558
|
name: stringType(),
|
package/bin.cjs
CHANGED
|
@@ -22908,7 +22908,7 @@ var init_common3 = __esm({
|
|
|
22908
22908
|
configCommonSchema = objectType({
|
|
22909
22909
|
dialect,
|
|
22910
22910
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
22911
|
-
out: stringType().
|
|
22911
|
+
out: stringType().default("drizzle"),
|
|
22912
22912
|
breakpoints: booleanType().optional().default(true),
|
|
22913
22913
|
verbose: booleanType().optional().default(false),
|
|
22914
22914
|
driver: driver.optional(),
|
|
@@ -28408,7 +28408,7 @@ var init_snapshot6 = __esm({
|
|
|
28408
28408
|
}).strict();
|
|
28409
28409
|
compositePK5 = objectType({
|
|
28410
28410
|
columns: stringType().array(),
|
|
28411
|
-
name: stringType()
|
|
28411
|
+
name: stringType().optional()
|
|
28412
28412
|
}).strict();
|
|
28413
28413
|
column5 = objectType({
|
|
28414
28414
|
name: stringType(),
|
|
@@ -28509,7 +28509,14 @@ var init_snapshot6 = __esm({
|
|
|
28509
28509
|
sqliteSchemaV5 = schemaV52;
|
|
28510
28510
|
sqliteSchemaV6 = schemaV62;
|
|
28511
28511
|
toJsonSnapshot6 = (ddl7, id, prevIds, renames) => {
|
|
28512
|
-
return {
|
|
28512
|
+
return {
|
|
28513
|
+
dialect: "sqlite",
|
|
28514
|
+
id,
|
|
28515
|
+
prevIds,
|
|
28516
|
+
version: "7",
|
|
28517
|
+
ddl: ddl7.entities.list(),
|
|
28518
|
+
renames
|
|
28519
|
+
};
|
|
28513
28520
|
};
|
|
28514
28521
|
ddl6 = createDDL5();
|
|
28515
28522
|
snapshotValidator6 = validator({
|
|
@@ -180142,15 +180149,12 @@ init_views();
|
|
|
180142
180149
|
init_generate_common();
|
|
180143
180150
|
var prepareCheckParams = async (options, from) => {
|
|
180144
180151
|
const config = from === "config" ? await drizzleConfigFromFile(options.config) : options;
|
|
180145
|
-
if (!config.
|
|
180146
|
-
|
|
180147
|
-
|
|
180148
|
-
console.log(error2(text));
|
|
180149
|
-
console.log(wrapParam("database", config.out));
|
|
180150
|
-
console.log(wrapParam("secretArn", config.dialect));
|
|
180152
|
+
if (!config.dialect) {
|
|
180153
|
+
console.log(error2("Please provide required params:"));
|
|
180154
|
+
console.log(wrapParam("dialect", dialect));
|
|
180151
180155
|
process.exit(1);
|
|
180152
180156
|
}
|
|
180153
|
-
return { out: config.out, dialect: config.dialect };
|
|
180157
|
+
return { out: config.out || "drizzle", dialect: config.dialect };
|
|
180154
180158
|
};
|
|
180155
180159
|
var prepareGenerateConfig = async (options, from) => {
|
|
180156
180160
|
var _a5;
|
|
@@ -180334,11 +180338,7 @@ var preparePushConfig = async (options, from) => {
|
|
|
180334
180338
|
};
|
|
180335
180339
|
}
|
|
180336
180340
|
if (config.dialect === "gel") {
|
|
180337
|
-
console.log(
|
|
180338
|
-
error2(
|
|
180339
|
-
`You can't use 'push' command with Gel dialect`
|
|
180340
|
-
)
|
|
180341
|
-
);
|
|
180341
|
+
console.log(error2(`You can't use 'push' command with Gel dialect`));
|
|
180342
180342
|
process.exit(1);
|
|
180343
180343
|
}
|
|
180344
180344
|
if (config.dialect === "mssql") {
|
|
@@ -180792,11 +180792,7 @@ var prepareMigrateConfig = async (configPath) => {
|
|
|
180792
180792
|
};
|
|
180793
180793
|
}
|
|
180794
180794
|
if (dialect5 === "gel") {
|
|
180795
|
-
console.log(
|
|
180796
|
-
error2(
|
|
180797
|
-
`You can't use 'migrate' command with Gel dialect`
|
|
180798
|
-
)
|
|
180799
|
-
);
|
|
180795
|
+
console.log(error2(`You can't use 'migrate' command with Gel dialect`));
|
|
180800
180796
|
process.exit(1);
|
|
180801
180797
|
}
|
|
180802
180798
|
if (dialect5 === "mssql") {
|
|
@@ -180841,8 +180837,12 @@ var prepareMigrateConfig = async (configPath) => {
|
|
|
180841
180837
|
};
|
|
180842
180838
|
var drizzleConfigFromFile = async (configPath, isExport) => {
|
|
180843
180839
|
const prefix2 = process.env.TEST_CONFIG_PATH_PREFIX || "";
|
|
180844
|
-
const defaultTsConfigExists = (0, import_fs5.existsSync)(
|
|
180845
|
-
|
|
180840
|
+
const defaultTsConfigExists = (0, import_fs5.existsSync)(
|
|
180841
|
+
(0, import_path3.resolve)((0, import_path3.join)(prefix2, "drizzle.config.ts"))
|
|
180842
|
+
);
|
|
180843
|
+
const defaultJsConfigExists = (0, import_fs5.existsSync)(
|
|
180844
|
+
(0, import_path3.resolve)((0, import_path3.join)(prefix2, "drizzle.config.js"))
|
|
180845
|
+
);
|
|
180846
180846
|
const defaultConfigPath = defaultTsConfigExists ? "drizzle.config.ts" : defaultJsConfigExists ? "drizzle.config.js" : "drizzle.config.json";
|
|
180847
180847
|
if (!configPath && !isExport) {
|
|
180848
180848
|
console.log(
|
|
@@ -180900,12 +180900,17 @@ var migrateToFoldersV3 = (out) => {
|
|
|
180900
180900
|
}
|
|
180901
180901
|
const oldSql = (0, import_fs5.readFileSync)(oldSqlPath);
|
|
180902
180902
|
(0, import_fs5.mkdirSync)((0, import_path3.join)(out, `${folderName}_${migrationName}`));
|
|
180903
|
-
(0, import_fs5.writeFileSync)(
|
|
180904
|
-
|
|
180903
|
+
(0, import_fs5.writeFileSync)(
|
|
180904
|
+
(0, import_path3.join)(out, `${folderName}_${migrationName}/snapshot.json`),
|
|
180905
|
+
oldSnapshot
|
|
180906
|
+
);
|
|
180907
|
+
(0, import_fs5.writeFileSync)(
|
|
180908
|
+
(0, import_path3.join)(out, `${folderName}_${migrationName}/migration.sql`),
|
|
180909
|
+
oldSql
|
|
180910
|
+
);
|
|
180905
180911
|
(0, import_fs5.unlinkSync)(oldSqlPath);
|
|
180906
180912
|
}
|
|
180907
|
-
(0, import_fs5.
|
|
180908
|
-
});
|
|
180913
|
+
(0, import_fs5.rmSync)(metaPath, { recursive: true, force: true });
|
|
180909
180914
|
return true;
|
|
180910
180915
|
}
|
|
180911
180916
|
return false;
|
|
@@ -180966,7 +180971,10 @@ var upToV6 = (it2) => {
|
|
|
180966
180971
|
for (const index6 of Object.values(table6.indexes)) {
|
|
180967
180972
|
const columns = index6.columns.map((x6) => {
|
|
180968
180973
|
const nameToCheck = trimChar(x6, "`");
|
|
180969
|
-
const isColumn = !!ddl7.columns.one({
|
|
180974
|
+
const isColumn = !!ddl7.columns.one({
|
|
180975
|
+
table: table6.name,
|
|
180976
|
+
name: nameToCheck
|
|
180977
|
+
});
|
|
180970
180978
|
return { value: x6, isExpression: !isColumn };
|
|
180971
180979
|
});
|
|
180972
180980
|
ddl7.indexes.push({
|
|
@@ -180980,61 +180988,72 @@ var upToV6 = (it2) => {
|
|
|
180980
180988
|
nameExplicit: true
|
|
180981
180989
|
});
|
|
180982
180990
|
}
|
|
180983
|
-
|
|
180984
|
-
const
|
|
180985
|
-
const
|
|
180986
|
-
|
|
180987
|
-
|
|
180988
|
-
|
|
180989
|
-
|
|
180990
|
-
|
|
180991
|
-
|
|
180992
|
-
|
|
180993
|
-
columns
|
|
180994
|
-
|
|
180995
|
-
|
|
180996
|
-
|
|
180997
|
-
|
|
180998
|
-
|
|
180999
|
-
|
|
180991
|
+
if (table6.uniqueConstraints) {
|
|
180992
|
+
for (const unique of Object.values(table6.uniqueConstraints)) {
|
|
180993
|
+
const columns = unique.columns.map((x6) => {
|
|
180994
|
+
const nameToCheck = trimChar(x6, "`");
|
|
180995
|
+
const isColumn = !!ddl7.columns.one({
|
|
180996
|
+
table: table6.name,
|
|
180997
|
+
name: nameToCheck
|
|
180998
|
+
});
|
|
180999
|
+
return { value: x6, isExpression: !isColumn };
|
|
181000
|
+
});
|
|
181001
|
+
let nameImplicit = `${table6.name}_${unique.columns.join("_")}_unique` === unique.name || `${table6.name}_${unique.columns.join("_")}` === unique.name;
|
|
181002
|
+
ddl7.indexes.push({
|
|
181003
|
+
table: table6.name,
|
|
181004
|
+
name: unique.name,
|
|
181005
|
+
columns,
|
|
181006
|
+
algorithm: null,
|
|
181007
|
+
isUnique: true,
|
|
181008
|
+
lock: null,
|
|
181009
|
+
using: null,
|
|
181010
|
+
nameExplicit: !nameImplicit
|
|
181011
|
+
});
|
|
181012
|
+
}
|
|
181000
181013
|
}
|
|
181001
|
-
|
|
181002
|
-
const
|
|
181003
|
-
|
|
181004
|
-
|
|
181005
|
-
|
|
181006
|
-
|
|
181007
|
-
|
|
181008
|
-
|
|
181009
|
-
|
|
181010
|
-
|
|
181011
|
-
|
|
181012
|
-
|
|
181014
|
+
if (table6.foreignKeys) {
|
|
181015
|
+
for (const fk5 of Object.values(table6.foreignKeys)) {
|
|
181016
|
+
const isNameImplicit = `${fk5.tableFrom}_${fk5.columnsFrom.join("_")}_${fk5.tableTo}_${fk5.columnsTo.join("_")}_fk` === fk5.name;
|
|
181017
|
+
ddl7.fks.push({
|
|
181018
|
+
table: table6.name,
|
|
181019
|
+
name: fk5.name,
|
|
181020
|
+
columns: fk5.columnsFrom,
|
|
181021
|
+
columnsTo: fk5.columnsTo,
|
|
181022
|
+
tableTo: fk5.tableTo,
|
|
181023
|
+
onUpdate: ((_a5 = fk5.onUpdate) == null ? void 0 : _a5.toUpperCase()) ?? null,
|
|
181024
|
+
onDelete: ((_b = fk5.onDelete) == null ? void 0 : _b.toUpperCase()) ?? null,
|
|
181025
|
+
nameExplicit: !isNameImplicit
|
|
181026
|
+
});
|
|
181027
|
+
}
|
|
181013
181028
|
}
|
|
181014
|
-
|
|
181015
|
-
|
|
181016
|
-
|
|
181017
|
-
|
|
181018
|
-
|
|
181019
|
-
|
|
181029
|
+
if (table6.checkConstraint) {
|
|
181030
|
+
for (const check2 of Object.values(table6.checkConstraint)) {
|
|
181031
|
+
ddl7.checks.push({
|
|
181032
|
+
table: table6.name,
|
|
181033
|
+
name: check2.name,
|
|
181034
|
+
value: check2.value
|
|
181035
|
+
});
|
|
181036
|
+
}
|
|
181037
|
+
for (const pk of Object.values(table6.compositePrimaryKeys)) {
|
|
181038
|
+
ddl7.pks.push({
|
|
181039
|
+
table: table6.name,
|
|
181040
|
+
name: "PRIMARY",
|
|
181041
|
+
columns: pk.columns
|
|
181042
|
+
});
|
|
181043
|
+
}
|
|
181020
181044
|
}
|
|
181021
|
-
|
|
181022
|
-
|
|
181023
|
-
|
|
181024
|
-
|
|
181025
|
-
|
|
181045
|
+
}
|
|
181046
|
+
if (json.views) {
|
|
181047
|
+
for (const view5 of Object.values(json.views)) {
|
|
181048
|
+
ddl7.views.push({
|
|
181049
|
+
name: view5.name,
|
|
181050
|
+
algorithm: view5.algorithm ?? null,
|
|
181051
|
+
sqlSecurity: view5.sqlSecurity ?? null,
|
|
181052
|
+
withCheckOption: view5.withCheckOption ?? null,
|
|
181053
|
+
definition: view5.definition
|
|
181026
181054
|
});
|
|
181027
181055
|
}
|
|
181028
181056
|
}
|
|
181029
|
-
for (const view5 of Object.values(json.views)) {
|
|
181030
|
-
ddl7.views.push({
|
|
181031
|
-
name: view5.name,
|
|
181032
|
-
algorithm: view5.algorithm ?? null,
|
|
181033
|
-
sqlSecurity: view5.sqlSecurity ?? null,
|
|
181034
|
-
withCheckOption: view5.withCheckOption ?? null,
|
|
181035
|
-
definition: view5.definition
|
|
181036
|
-
});
|
|
181037
|
-
}
|
|
181038
181057
|
return {
|
|
181039
181058
|
version: "6",
|
|
181040
181059
|
id: json.id,
|
|
@@ -181062,21 +181081,25 @@ var upToV8 = (it2) => {
|
|
|
181062
181081
|
for (const schema5 of Object.values(json.schemas)) {
|
|
181063
181082
|
ddl7.schemas.push({ name: schema5 });
|
|
181064
181083
|
}
|
|
181065
|
-
|
|
181066
|
-
|
|
181067
|
-
|
|
181068
|
-
|
|
181069
|
-
|
|
181070
|
-
|
|
181071
|
-
|
|
181072
|
-
|
|
181073
|
-
|
|
181074
|
-
|
|
181075
|
-
|
|
181084
|
+
if (json.sequences) {
|
|
181085
|
+
for (const seq of Object.values(json.sequences)) {
|
|
181086
|
+
ddl7.sequences.push({
|
|
181087
|
+
schema: seq.schema,
|
|
181088
|
+
name: seq.name,
|
|
181089
|
+
startWith: seq.startWith ?? null,
|
|
181090
|
+
incrementBy: seq.increment ?? null,
|
|
181091
|
+
minValue: seq.minValue ?? null,
|
|
181092
|
+
maxValue: seq.maxValue ?? null,
|
|
181093
|
+
cacheSize: seq.cache ? Number(seq.cache) : null,
|
|
181094
|
+
cycle: seq.cycle ?? null
|
|
181095
|
+
});
|
|
181096
|
+
}
|
|
181076
181097
|
}
|
|
181077
181098
|
for (const table6 of Object.values(json.tables)) {
|
|
181078
181099
|
const schema5 = table6.schema || "public";
|
|
181079
|
-
const isRlsEnabled = table6.isRLSEnabled || Object.keys(table6.policies).length > 0 || Object.values(json.policies).some(
|
|
181100
|
+
const isRlsEnabled = table6.isRLSEnabled || Object.keys(table6.policies).length > 0 || Object.values(json.policies).some(
|
|
181101
|
+
(it3) => it3.on === table6.name && (it3.schema ?? "public") === schema5
|
|
181102
|
+
);
|
|
181080
181103
|
ddl7.tables.push({
|
|
181081
181104
|
schema: schema5,
|
|
181082
181105
|
name: table6.name,
|
|
@@ -181117,33 +181140,41 @@ var upToV8 = (it2) => {
|
|
|
181117
181140
|
default: typeof column11.default === "undefined" ? null : trimDefaultValueSuffix(String(column11.default))
|
|
181118
181141
|
});
|
|
181119
181142
|
}
|
|
181120
|
-
|
|
181121
|
-
const
|
|
181122
|
-
|
|
181123
|
-
|
|
181143
|
+
if (table6.compositePrimaryKeys) {
|
|
181144
|
+
for (const pk of Object.values(table6.compositePrimaryKeys)) {
|
|
181145
|
+
const nameExplicit = `${table6.name}_${pk.columns.join("_")}_pk` !== pk.name;
|
|
181146
|
+
if (!nameExplicit) {
|
|
181147
|
+
hints.push(
|
|
181148
|
+
`update pk name: ${pk.name} -> ${defaultNameForPK(table6.name)}`
|
|
181149
|
+
);
|
|
181150
|
+
}
|
|
181151
|
+
ddl7.pks.push({
|
|
181152
|
+
schema: schema5,
|
|
181153
|
+
table: table6.name,
|
|
181154
|
+
name: pk.name,
|
|
181155
|
+
columns: pk.columns,
|
|
181156
|
+
nameExplicit
|
|
181157
|
+
// TODO: ??
|
|
181158
|
+
});
|
|
181124
181159
|
}
|
|
181125
|
-
ddl7.pks.push({
|
|
181126
|
-
schema: schema5,
|
|
181127
|
-
table: table6.name,
|
|
181128
|
-
name: pk.name,
|
|
181129
|
-
columns: pk.columns,
|
|
181130
|
-
nameExplicit
|
|
181131
|
-
// TODO: ??
|
|
181132
|
-
});
|
|
181133
181160
|
}
|
|
181134
|
-
|
|
181135
|
-
const
|
|
181136
|
-
|
|
181137
|
-
|
|
181161
|
+
if (table6.uniqueConstraints) {
|
|
181162
|
+
for (const unique of Object.values(table6.uniqueConstraints)) {
|
|
181163
|
+
const nameExplicit = `${table6.name}_${unique.columns.join("_")}_unique` !== unique.name;
|
|
181164
|
+
if (!nameExplicit) {
|
|
181165
|
+
hints.push(
|
|
181166
|
+
`update unique name: ${unique.name} -> ${defaultNameForUnique(table6.name, ...unique.columns)}`
|
|
181167
|
+
);
|
|
181168
|
+
}
|
|
181169
|
+
ddl7.uniques.push({
|
|
181170
|
+
schema: schema5,
|
|
181171
|
+
table: table6.name,
|
|
181172
|
+
columns: unique.columns,
|
|
181173
|
+
name: unique.name,
|
|
181174
|
+
nameExplicit,
|
|
181175
|
+
nullsNotDistinct: unique.nullsNotDistinct ?? defaults.nullsNotDistinct
|
|
181176
|
+
});
|
|
181138
181177
|
}
|
|
181139
|
-
ddl7.uniques.push({
|
|
181140
|
-
schema: schema5,
|
|
181141
|
-
table: table6.name,
|
|
181142
|
-
columns: unique.columns,
|
|
181143
|
-
name: unique.name,
|
|
181144
|
-
nameExplicit,
|
|
181145
|
-
nullsNotDistinct: unique.nullsNotDistinct ?? defaults.nullsNotDistinct
|
|
181146
|
-
});
|
|
181147
181178
|
}
|
|
181148
181179
|
for (const check2 of Object.values(table6.checkConstraints)) {
|
|
181149
181180
|
ddl7.checks.push({
|
|
@@ -181169,7 +181200,10 @@ var upToV8 = (it2) => {
|
|
|
181169
181200
|
const nameExplicit = columns.some((it3) => it3.isExpression === true) || `${table6.name}_${columns.map((it3) => it3.value).join("_")}_index` !== idx.name;
|
|
181170
181201
|
if (!nameExplicit) {
|
|
181171
181202
|
hints.push(
|
|
181172
|
-
`rename index name: ${idx.name} -> ${defaultNameForIndex(
|
|
181203
|
+
`rename index name: ${idx.name} -> ${defaultNameForIndex(
|
|
181204
|
+
table6.name,
|
|
181205
|
+
idx.columns.map((x6) => x6.expression)
|
|
181206
|
+
)}`
|
|
181173
181207
|
);
|
|
181174
181208
|
}
|
|
181175
181209
|
ddl7.indexes.push({
|
|
@@ -181261,16 +181295,43 @@ var upToV8 = (it2) => {
|
|
|
181261
181295
|
autovacuumEnabled: getOrNull(opt, "autovacuumEnabled"),
|
|
181262
181296
|
autovacuumFreezeMaxAge: getOrNull(opt, "autovacuumFreezeMaxAge"),
|
|
181263
181297
|
autovacuumFreezeMinAge: getOrNull(opt, "autovacuumFreezeMinAge"),
|
|
181264
|
-
autovacuumFreezeTableAge: getOrNull(
|
|
181265
|
-
|
|
181266
|
-
|
|
181267
|
-
|
|
181268
|
-
|
|
181269
|
-
|
|
181270
|
-
|
|
181271
|
-
|
|
181298
|
+
autovacuumFreezeTableAge: getOrNull(
|
|
181299
|
+
opt,
|
|
181300
|
+
"autovacuumFreezeTableAge"
|
|
181301
|
+
),
|
|
181302
|
+
autovacuumMultixactFreezeMaxAge: getOrNull(
|
|
181303
|
+
opt,
|
|
181304
|
+
"autovacuumMultixactFreezeMaxAge"
|
|
181305
|
+
),
|
|
181306
|
+
autovacuumMultixactFreezeMinAge: getOrNull(
|
|
181307
|
+
opt,
|
|
181308
|
+
"autovacuumMultixactFreezeMinAge"
|
|
181309
|
+
),
|
|
181310
|
+
autovacuumMultixactFreezeTableAge: getOrNull(
|
|
181311
|
+
opt,
|
|
181312
|
+
"autovacuumMultixactFreezeTableAge"
|
|
181313
|
+
),
|
|
181314
|
+
autovacuumVacuumCostDelay: getOrNull(
|
|
181315
|
+
opt,
|
|
181316
|
+
"autovacuumVacuumCostDelay"
|
|
181317
|
+
),
|
|
181318
|
+
autovacuumVacuumCostLimit: getOrNull(
|
|
181319
|
+
opt,
|
|
181320
|
+
"autovacuumVacuumCostLimit"
|
|
181321
|
+
),
|
|
181322
|
+
autovacuumVacuumScaleFactor: getOrNull(
|
|
181323
|
+
opt,
|
|
181324
|
+
"autovacuumVacuumScaleFactor"
|
|
181325
|
+
),
|
|
181326
|
+
autovacuumVacuumThreshold: getOrNull(
|
|
181327
|
+
opt,
|
|
181328
|
+
"autovacuumVacuumThreshold"
|
|
181329
|
+
),
|
|
181272
181330
|
fillfactor: getOrNull(opt, "fillfactor"),
|
|
181273
|
-
logAutovacuumMinDuration: getOrNull(
|
|
181331
|
+
logAutovacuumMinDuration: getOrNull(
|
|
181332
|
+
opt,
|
|
181333
|
+
"logAutovacuumMinDuration"
|
|
181334
|
+
),
|
|
181274
181335
|
parallelWorkers: getOrNull(opt, "parallelWorkers"),
|
|
181275
181336
|
toastTupleTarget: getOrNull(opt, "toastTupleTarget"),
|
|
181276
181337
|
userCatalogTable: getOrNull(opt, "userCatalogTable"),
|
|
@@ -181312,19 +181373,30 @@ var updateUpToV7 = (it2) => {
|
|
|
181312
181373
|
const mappedIndexes = Object.fromEntries(
|
|
181313
181374
|
Object.entries(table6.indexes).map((idx) => {
|
|
181314
181375
|
const { columns, ...rest } = idx[1];
|
|
181315
|
-
const mappedColumns = columns.map(
|
|
181316
|
-
|
|
181317
|
-
|
|
181318
|
-
|
|
181319
|
-
|
|
181320
|
-
|
|
181321
|
-
|
|
181322
|
-
|
|
181323
|
-
|
|
181376
|
+
const mappedColumns = columns.map(
|
|
181377
|
+
(it4) => {
|
|
181378
|
+
return {
|
|
181379
|
+
expression: it4,
|
|
181380
|
+
isExpression: false,
|
|
181381
|
+
asc: true,
|
|
181382
|
+
nulls: "last",
|
|
181383
|
+
opClass: void 0
|
|
181384
|
+
};
|
|
181385
|
+
}
|
|
181386
|
+
);
|
|
181324
181387
|
return [idx[0], { columns: mappedColumns, with: {}, ...rest }];
|
|
181325
181388
|
})
|
|
181326
181389
|
);
|
|
181327
|
-
return [
|
|
181390
|
+
return [
|
|
181391
|
+
it3[0],
|
|
181392
|
+
{
|
|
181393
|
+
...table6,
|
|
181394
|
+
indexes: mappedIndexes,
|
|
181395
|
+
policies: {},
|
|
181396
|
+
isRLSEnabled: false,
|
|
181397
|
+
checkConstraints: {}
|
|
181398
|
+
}
|
|
181399
|
+
];
|
|
181328
181400
|
})
|
|
181329
181401
|
);
|
|
181330
181402
|
return {
|
|
@@ -182391,7 +182463,7 @@ init_views();
|
|
|
182391
182463
|
var version3 = async () => {
|
|
182392
182464
|
const { npmVersion } = await ormCoreVersions();
|
|
182393
182465
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
|
182394
|
-
const envVersion = "1.0.0-beta.
|
|
182466
|
+
const envVersion = "1.0.0-beta.4";
|
|
182395
182467
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
|
182396
182468
|
const versions = `drizzle-kit: ${kitVersion}
|
|
182397
182469
|
${ormVersion}`;
|