-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
How to downgrade sea-orm-cli version? #1286
Comments
Hey @frederikhors, please use the following command to degrade cargo install --version 0.10.2 sea-orm-cli |
I tried this too and with |
Hmmm... why? Did you try uninstall it first then install it again? |
Yeah! Of course! |
I used: cargo uninstall sea-orm-cli
Removing C:\Users\Fred\.cargo\bin\sea-orm-cli.exe
Removing C:\Users\Fred\.cargo\bin\sea.exe |
And try restarting the command prompt after installation |
Then I installed with: cargo install --version 0.10.2 sea-orm-cli
...
Compiling tracing-subscriber v0.3.16
Compiling clap v3.2.23
Compiling chrono v0.4.23
Compiling sqlx v0.6.2
Compiling sea-query-binder v0.2.2
Compiling sea-schema v0.10.3
Compiling sea-orm-codegen v0.10.5
Compiling sea-orm-cli v0.10.2
Finished release [optimized] target(s) in 2m 48s
Installing C:\Users\Fred\.cargo\bin\sea-orm-cli.exe
Installing C:\Users\Fred\.cargo\bin\sea.exe
Installed package `sea-orm-cli v0.10.2` (executables `sea-orm-cli.exe`, `sea.exe`) Now it is 0.10.2. If I generate the files have the comment (and the differences) of the 0.10.5! Crazy! |
I restarted the shell (Powershell-Core). The same. |
It's crazy because the .exe in cargo's bin directory is the new one! |
I suspect this is the result of some weird caching issue |
Yeah but the executable is new. It's installed with the command |
Please :) |
I did. I removed everything because this is a new PC. I manully removed cache directories too. I installed rustup & cargo again, and sea-orm-cli with 0.10.2. Nothing. The generation is for 0.10.5. I give up. This is totally crazy. |
This is really bad because I'm stucked right now. I cannot generate nor new table or old ones. Is there a way I can use Cargo.toml to fix the version o sea-orm-cli avoiding the executable? |
Is it possible that during compilation on my PC cargo uses master branch files or latest tag ones? |
I guess you can git clone the project at 0.10.2 tag. Then run the CLI locally. |
Yeah. I will in a few minutes temporarily. I think this should work. What do you think could be the problem? Have you tried the downgrade on your PC? |
Okay. I think I think what have happened! Check how sea-orm/sea-orm-cli/Cargo.toml Line 37 in f23c99b
Basically, it will pick the latest |
Wow! This is the issue. How can we fix this? |
Also we have to fix this for older versions too? https://github.com/SeaQL/sea-orm/blob/0.10.2/sea-orm-cli/Cargo.toml |
It's intended to always fetch the latest 0.10.x sea-orm-codegen. |
I think this is not the correct behavior. In this case we were stuck because of the bug of the related trait. I think we need a way to downgrade safely. |
Oh. sorry... didn't mean to close this issue |
Ok. It was a little bit strange! 😄 |
So, the intention is to compile with the latest codegen but as a side effect, one cannot downgrade to 0.10.x unless going below it e.g. 0.9.x I think we should make it sea-orm-codegen = { version = "=0.10.5", ... } |
Is there a way we can choose in |
Yes, only if you clone this repository into local then modify the |
Yes, I meant for the future. Wouldn't there be a way just using Cargo.toml? |
Note that every time we released a new |
If I install with:
and generate with:
the generated file have:
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.5
instead of of
0.10.2
.If I run
I can see:
What is going on?
I need the 0.10.2 version right now.
The text was updated successfully, but these errors were encountered: