Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow importing/specifying migrations instead of pointing to directory #950

Open
moodysalem opened this issue Dec 10, 2023 · 3 comments
Open
Labels
s: pending triage Pending Triage

Comments

@moodysalem
Copy link

this would make it easier for me to use the tool because i run migrations programmatically before my application starts, and i want the transpilation/build process to apply to migration files

@moodysalem moodysalem changed the title allow importing migrations instead of pointing to directory allow importing/specifying migrations instead of pointing to directory Dec 10, 2023
@Shinigami92 Shinigami92 added the s: pending triage Pending Triage label Apr 26, 2024
@Shinigami92
Copy link
Collaborator

Could you explain a bit more?

How is your file-structure?
How do you call node-pg-migrate?
How do you want to call it instead?
Do you have an example Open Source repo you could link to show how it should be improved?

@moodysalem
Copy link
Author

Could you explain a bit more?

How is your file-structure? How do you call node-pg-migrate? How do you want to call it instead? Do you have an example Open Source repo you could link to show how it should be improved?

This is how I currently do schema https://github.com/EkuboProtocol/indexer/blob/84392cc4809fa02dc54a4c16c1333f26f583e03c/src/dao.ts#L101

I just want something that lets me organize this into a list of changesets and creates/manages a DB table for tracking migration state. I still want to use all typescript everywhere

@Shinigami92
Copy link
Collaborator

Ok, yeah, that is a lot 🤔
node-pg-migrate could only handle the createSchema stuff, but you have far more other stuff also below as well.
Did you considered trying out knex?

Either way, node-pg-migrate can use .ts migration files, but these would fully be moved to a separate migration folder. I would need to check myself how to execute these migrations then programmatically from inside a project startup.

I think I will come back to this issue later, and currently focus priority to some other more minor stuff. I hope that's ok. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: pending triage Pending Triage
Projects
None yet
Development

No branches or pull requests

2 participants