bun-query-builder 0.2.37 → 0.2.38
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/dist/bin/cli.js +12 -8
- package/dist/src/index.js +11 -7
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -19567,21 +19567,25 @@ async function resetDatabase(dir, opts = {}) {
|
|
|
19567
19567
|
} else {
|
|
19568
19568
|
info("-- No enum types found to drop");
|
|
19569
19569
|
}
|
|
19570
|
-
if (tableNames.length > 0) {
|
|
19570
|
+
if (tableNames.length > 0 && !opts.preserveMigrationState) {
|
|
19571
19571
|
try {
|
|
19572
19572
|
await deleteMigrationFiles(dir, workspaceRoot, opts);
|
|
19573
19573
|
} catch (err) {
|
|
19574
19574
|
console.error(err);
|
|
19575
19575
|
info("-- Could not clean up migration files");
|
|
19576
19576
|
}
|
|
19577
|
-
} else {
|
|
19577
|
+
} else if (tableNames.length === 0) {
|
|
19578
19578
|
info("-- No models directory found; keeping committed migration files in place");
|
|
19579
|
+
} else {
|
|
19580
|
+
info("-- Preserving migration files and model snapshot for fresh replay");
|
|
19579
19581
|
}
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19582
|
+
if (!opts.preserveMigrationState) {
|
|
19583
|
+
try {
|
|
19584
|
+
await clearGeneratedDirectory(workspaceRoot);
|
|
19585
|
+
} catch (err) {
|
|
19586
|
+
console.error(err);
|
|
19587
|
+
info("-- Could not clear generated directory");
|
|
19588
|
+
}
|
|
19585
19589
|
}
|
|
19586
19590
|
info("-- Database reset completed successfully");
|
|
19587
19591
|
return true;
|
|
@@ -32329,7 +32333,7 @@ function getPrefix() {
|
|
|
32329
32333
|
}
|
|
32330
32334
|
var prefix = getPrefix();
|
|
32331
32335
|
// package.json
|
|
32332
|
-
var version2 = "0.2.
|
|
32336
|
+
var version2 = "0.2.38";
|
|
32333
32337
|
|
|
32334
32338
|
// bin/cli.ts
|
|
32335
32339
|
init_actions();
|
package/dist/src/index.js
CHANGED
|
@@ -19566,21 +19566,25 @@ async function resetDatabase(dir, opts = {}) {
|
|
|
19566
19566
|
} else {
|
|
19567
19567
|
info("-- No enum types found to drop");
|
|
19568
19568
|
}
|
|
19569
|
-
if (tableNames.length > 0) {
|
|
19569
|
+
if (tableNames.length > 0 && !opts.preserveMigrationState) {
|
|
19570
19570
|
try {
|
|
19571
19571
|
await deleteMigrationFiles(dir, workspaceRoot, opts);
|
|
19572
19572
|
} catch (err) {
|
|
19573
19573
|
console.error(err);
|
|
19574
19574
|
info("-- Could not clean up migration files");
|
|
19575
19575
|
}
|
|
19576
|
-
} else {
|
|
19576
|
+
} else if (tableNames.length === 0) {
|
|
19577
19577
|
info("-- No models directory found; keeping committed migration files in place");
|
|
19578
|
+
} else {
|
|
19579
|
+
info("-- Preserving migration files and model snapshot for fresh replay");
|
|
19578
19580
|
}
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19581
|
+
if (!opts.preserveMigrationState) {
|
|
19582
|
+
try {
|
|
19583
|
+
await clearGeneratedDirectory(workspaceRoot);
|
|
19584
|
+
} catch (err) {
|
|
19585
|
+
console.error(err);
|
|
19586
|
+
info("-- Could not clear generated directory");
|
|
19587
|
+
}
|
|
19584
19588
|
}
|
|
19585
19589
|
info("-- Database reset completed successfully");
|
|
19586
19590
|
return true;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED