This session description the workflow related to erd.txt
and database schema migration.
You can copy the content of erd.txt
into the hosted web ui.
The hosted version store the content in LocalStorage, so the changes are persisted across page reload. You can then paste the updated version back to erd.txt
.
In some region, it may take quite some time to load the website, you can run the web ui locally as well.
Command to run the web ui of erd locally:
npm run ui
The local version can auto load and save the content of erd.txt
on your disk.
Remark: cd to db
if not done already
Auto mode:
- update
erd.txt
with any text editor - run
npm run update
Manual mode:
- update
erd.txt
with any text editor - run
npm run gen-migrate
- review the generated migration script in the
migrations
directory - run
npm run migrate
- run
npm run gen-proxy
You can setup configuration data and sample data in seed.ts
, then run it with npm run seed
.
This package is used to isolate knex from top-level package.
We're using esm on the top-level package but knex with typescript only works in commonjs package.
The files here are compiled and imported from the server directly, so the dependencies of this package should appear on the top-level package.json as well.