Skip to content

Commit

Permalink
Fixed: drizzle kit is now interactive #93
Browse files Browse the repository at this point in the history
  • Loading branch information
rizen committed Apr 11, 2024
1 parent e3e6f84 commit 9f94487
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ outline: deep
* Implemented: user id in statistics and add clipboard copy #88
* Fixed: documentation for Related Records is broken #86
* Implemented: write docs for utils #89
* Fixed: drizzle kit is now interactive #93

## 2024-04-10
* Implemented: filterQualifier: true should be in the examples for all relation ids #96
Expand Down
13 changes: 2 additions & 11 deletions ving/cli/drizzle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { vingSchemas } from '#ving/schema/map.mjs';
import ving from '#ving/index.mjs';
import crypto from "node:crypto";
import fs from "node:fs";
import { spawn } from 'child_process';

export default defineCommand({
meta: {
Expand Down Expand Up @@ -74,17 +75,7 @@ export default defineCommand({
runMigrations();
}
else if (args.prepare) {
exec("npx drizzle-kit generate:mysql --out ./ving/drizzle/migrations --schema ving/drizzle/schema", (error, stdout, stderr) => {
if (error) {
ving.log('cli').error(error.message);
return;
}
if (stderr) {
ving.log('cli').error(stderr);
return;
}
ving.log('cli').info(stdout);
});
spawn('npx drizzle-kit generate:mysql --out ./ving/drizzle/migrations --schema ving/drizzle/schema', [], { stdio: 'inherit', shell: true });
}
else {
await showUsage(cmd, { meta: { name: 'ving.mjs' } });
Expand Down

0 comments on commit 9f94487

Please sign in to comment.