Skip to content

Commit

Permalink
build: add generate erd tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Aug 1, 2023
1 parent 09bbc38 commit 3340f89
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
14 changes: 14 additions & 0 deletions models/sql/generate-erd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require("module-alias/register");
const fsP = require("fs/promises");
const sequelize = require("./instance");
const sequelizeErd = require("sequelize-erd");


require("./init").then(async()=> {
const svg = await sequelizeErd({
source: sequelize
}); // sequelizeErd() returns a Promise
await fsP.writeFile("./erd.svg", svg);
});


38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"eslint-config-prettier": "^8.5.0",
"mocha": "^10.2.0",
"mongodb-memory-server": "^8.12.2",
"sequelize-erd": "^1.3.1",
"standard-version": "^9.5.0",
"swagger-jsdoc": "^6.2.8"
}
Expand Down

0 comments on commit 3340f89

Please sign in to comment.