-
Notifications
You must be signed in to change notification settings - Fork 181
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
Write node-pg-migrate in TypeScript #502
Conversation
Ok ... first "problem" 😸 Do you (@dolezel) have a better solution? |
Current state
Problemhttps://github.com/Shinigami92/node-pg-migrate/blob/725ea4a/src/migration.ts#L44 Doesn't work as expected 🤔 Ref
Cant finish today 😕 |
All types from |
I used But I will work and improve more later |
The second option in this line is never used 🤔 Line 193 in e883e5b
Function definition: Lines 54 to 63 in e883e5b
Should I remove the second parameter? Or add a |
Legend! |
@Shinigami92 great 🎉 👏 I hope I will find time tomorrow to look at it.
|
|
In example if we specify |
@@ -44,8 +44,8 @@ export function createTrigger(mOptions: MigrationOptions) { | |||
operation, | |||
deferrable, | |||
deferred, | |||
functionArgs = [] | |||
}: TriggerOptions = triggerOptions; | |||
functionParams = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making it consistent with the type and with usage on other places. It is a breaking change. Needs to be mentioned in release notes!
I did not wanted to touch your runtime code |
Sure, I understand, but I'm afraid that there are some issues which will become apparent once we will switch to TS :/ |
I think the move to a Also I can try to run a migration with my project and look if there are any errors |
I will try to update this branch in the next few days |
I'm merging it to |
|
I will do so in some minutes/hours |
I have tested in my little (so far) setup with only 2 migrations and 2 tables. And it worked flawlessly. |
I tested my project: https://github.com/Shinigami92/star-citizen-trade-market-api yarn add -DT node-pg-migrate@next # installed ~4.0.0-alpha.0
yarn migrate up
yarn migrate down 3
yarn migrate up Everything works like a charm |
Spent some time trying to figure out why I couldn't get this setup working out of the box. Compared my config with the one at https://github.com/Shinigami92/star-citizen-trade-market-api and made some observations which I documenting here just in case someone else also has similar problems.
I used the following package script to get my setup working:
First time I've had typescript support in migrations and it's really great! |
Hey guys, how is the testing going? Do you have any approx date when this upgrade will land on master? |
RC candidate published 🎉 |
closes #501