Replies: 2 comments 5 replies
-
|
The migrations should run serially. I don't understand why would there be a problem. Can you dig deeper and investigate a bit? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I will try to provide a reproducible build |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Migrator fails when applying add column and drop column on the same attribute in one pass.
Steps to Reproduce
manager .create_table( Table::create() .table(BenchmarkResult::Table) .if_not_exists() .col( ColumnDef::new(BenchmarkResult::Id) .integer() .not_null() .auto_increment() .primary_key(), ) ) .await?;manager .alter_table( Table::alter() .table(BenchmarkResult::Table) .add_column( ColumnDef::new(BenchmarkResult::Status) .string() .not_null() .default("Pending"), ) .to_owned(), ) .await?;manager .alter_table( Table::alter() .table(BenchmarkResult::Table) .drop_column(BenchmarkResult::Status) .to_owned(), ) .await?;error
Expected Behavior
It migrates everything once, and not fail.
Actual Behavior
'Failed to run migrations for tests: Exec(SqlxError(Database(SqliteError { code: 1, message: "no such column: ""status""" })))',
Reproduces How Often
Always
Workarounds
Run migration in 2 passes
Reproducible Example
Versions
cargo tree | Select-String "sea-(.*)" | ForEach-Object { $_.Matches.Value }
sea-orm v0.12.2
sea-orm-macros v0.12.2 (proc-macro)
sea-bae v0.2.0 (proc-macro)
sea-query v0.30.0
sea-query-derive v0.4.0 (proc-macro)
sea-query-binder v0.5.0
sea-query v0.30.0 ()
sea-orm-migration v0.12.2
sea-orm v0.12.2 ()
sea-orm-cli v0.12.2
sea-schema v0.14.0
sea-query v0.30.0 ()
sea-schema-derive v0.2.0 (proc-macro)
sea-schema v0.14.0 ()
sea-orm v0.12.2 (*)
Windows 11, SQLite
Beta Was this translation helpful? Give feedback.
All reactions