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

sea-orm-cli migrate up can only apply 1 migration #1007

Closed
ringrid opened this issue Aug 30, 2022 · 2 comments · Fixed by #1010
Closed

sea-orm-cli migrate up can only apply 1 migration #1007

ringrid opened this issue Aug 30, 2022 · 2 comments · Fixed by #1010
Assignees

Comments

@ringrid
Copy link

ringrid commented Aug 30, 2022

sea-orm-cli version: 0.9.2
sea-orm-cli migrate up can only apply 1 pending migration, how does it apply all ?

@ctfdavis
Copy link

I think the sea-orm-cli migrate up only applies 1 pending migration. The source code of the up command has a default value 1 for the num option:

#[clap(about = "Apply pending migrations")]
Up {
    #[clap(
        value_parser,
        short,
        long,
        default_value = "1",
        help = "Number of pending migrations to apply"
    )]
    num: u32,
},
#[clap(value_parser, about = "Rollback applied migrations")]
 Down {
    #[clap(
        value_parser,
        short,
        long,
        default_value = "1",
        help = "Number of applied migrations to be rolled back"
    )]
    num: u32,
},

The documentation is wrong on this one. As it stands, I think there is no way to migrate all pending migrations using the cli.

@billy1624
Copy link
Member

Hey @ringrid @ctfdavis, the intended behaviour is that sea-orm-cli migrate up should apply all pending migration. While sea-orm-cli migrate up -n 1 only apply the first pending migration.

As a temporary workaround: execute sea-orm-cli migrate on your migration crate. It will apply all pending migration at once.

@billy1624 billy1624 moved this from In Progress to Review in SeaQL Dev Tracker Sep 1, 2022
@billy1624 billy1624 moved this from Review to Done in SeaQL Dev Tracker Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants