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

Upgrade to Sequelize 6 #787

Closed
wants to merge 2 commits into from
Closed

Upgrade to Sequelize 6 #787

wants to merge 2 commits into from

Conversation

kf6kjg
Copy link

@kf6kjg kf6kjg commented May 19, 2020

BREAKING CHANGE!: The breakage comes from following Sequelize's lead and requiring a minimum node version of 10 and switching out Bluebird for native promises.

@kf6kjg
Copy link
Author

kf6kjg commented May 19, 2020

Currently targeting the 6.0.0 beta release as that's what's available.

The breakage comes from following Sequelize's lead and requiring a minimum node version of 10 and switching out Bluebird for native promises.
Copy link
Member

@RobinBuschmann RobinBuschmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kf6kjg thanks for contributing :) I really appreciate your help.

@@ -26,7 +26,7 @@ export class BelongsToManyAssociation extends BaseAssociation {
const associatedClass = this.getAssociatedClass();
const throughOptions = this.getThroughOptions(sequelize);

const throughModel = typeof throughOptions === 'object' ? throughOptions.model : undefined;
const throughModel = typeof throughOptions === 'object' && typeof throughOptions.model !== "string" ? throughOptions.model : undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this change is necessary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because throughOptions.model has type string | typeof Model. The subsequent code isn't designed to handle the string case. Since my goals were to start with the minimal set of changes to make the code compatible with Sequelize 6 beta.6, this was the smallest fix to make the compiler and test suite happy.

src/sequelize/sequelize/sequelize-service.ts Outdated Show resolved Hide resolved
Was unneeded code from a failed attempt that wasn't stripped before making the previous commit.
@kf6kjg
Copy link
Author

kf6kjg commented Jun 8, 2020

@RobinBuschmann Did I fully answer your questions and issues?

@brianschardt
Copy link

Hope you are all well! This would be amazing to be released, as I think a lot of people that can benefit from it.

Copy link

@brianschardt brianschardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@negezor
Copy link

negezor commented Jun 25, 2020

Yesterday was the release of 6.1.0. It is worth checking for compatibility.

@kf6kjg
Copy link
Author

kf6kjg commented Jun 25, 2020

At the moment I’m in crunch time through the end of the month. Is anyone else here able to see if this change works as is or not?

@dougmaitelli
Copy link

I see this PR is open for quite some time now and still reference Sequelize 6 beta, which is not beta anymore and this package is not currently working with Sequelize 6.

Is there any plan to fix this? Or is it supposed to work with Sequelize 6?

@kf6kjg
Copy link
Author

kf6kjg commented Jun 26, 2020

As the author of this PR, yes the plan is to validate that it still works. But as I mentioned above I’m just a touch short on time at the moment. Would you be willing to build it and find out? It’d be very appreciated. :)

@dougmaitelli
Copy link

Hey @kf6kjg, I tried to test the code from your PR but it doesn't seem to work.
I can confirm the changes do fix the compilation errors with sequelize v6, but now application fails during start with the message:
Error: Please install pg package manually
However same project was working fine with v5 and pg is in fact installed.

@iam-dev0
Copy link
Contributor

iam-dev0 commented Jul 3, 2020

I was just about to exclude typescript-sequelize from my project to migrate to seqeulize@6 and then came across to this pull request. I'm going to test PR and see if it works for myself.

@iam-dev0
Copy link
Contributor

iam-dev0 commented Jul 3, 2020

and unfortunately, it didn't work for me. I gonna try to implement this on my own.

@brianschardt
Copy link

@Awais000 i think a lot of people could benefit from this. if you do find a solution that would be dope.

@iam-dev0
Copy link
Contributor

iam-dev0 commented Jul 3, 2020

@brianschardt I started working on it. I go release by release to implement and accommodate all the breaking changes. Almost done with 6.0.0 because of depreciation of blueBird some of the tests got disturbed.

@iam-dev0
Copy link
Contributor

iam-dev0 commented Jul 3, 2020

#807 there you go @brianschardt @RobinBuschmann I opened a pull request. Please do take a look at it.

@cyrilchapon
Copy link

How is this going ? :)

@jinkwon
Copy link

jinkwon commented Sep 27, 2020

is there any work in progress?

@kf6kjg
Copy link
Author

kf6kjg commented Oct 8, 2020

I'm closing this as pretty much everything I did was done in the already merged #807.

@kf6kjg kf6kjg closed this Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants