Open ayazemregm opened 1 month ago
You talking about something like #275?
Yes but for typescript generations, not sql if possible. Also I am having hard time to use CLI.
{
"db": {
"url": "postgres://postgres:123456@localhost:3002/postgres"
},
"schema": "public",
"createSchema": false,
"migrationsDir": "migrations",
"migrationsSchema": "public",
"createMigrationsSchema": false,
"migrationsTable": "pgmigrations",
"migrationFilenameFormat": "utc",
"migrationFileLanguage": "js",
"checkOrder": true,
"verbose": true,
"decamelize": false,
"tsconfig": "tsconfig.json"
}
This is my test config
I run npx node-pg-migrate -f ./pgm-config.json up and it tries to connect 5432 not 3002. Also it does not reference migration paths as well. When I change file name it gives error meaning it reads the file just does not apply the settings. I am probably missing something too obvious but wanted to ask here.
Please open dedicated issues for each separate issue you have, so I can better prioritize them and they don't get lost.
You should adjust the title to e.g. Generating initial TypeScript migration file based on existing schema
.
However, I think this will be a really huge task if not even impossible (because of hundreds of edge-cases) But feel free to try a PR 🤷
I took a quick look to docs but I could not find how to do schema diff. If I want to integrate this to already existing dbs do I need to write everything again or am I missing something?