add_column_if_not_exists doesn't work in mysql
This commit is contained in:
parent
c7f86bf54b
commit
c1a10b0342
@ -6,6 +6,16 @@ pub struct Migration;
|
|||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
impl MigrationTrait for Migration {
|
impl MigrationTrait for Migration {
|
||||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||||
|
// note: somehow this column got added in prod, but the migration wasn't marked as complete
|
||||||
|
let _ = manager
|
||||||
|
.alter_table(
|
||||||
|
Table::alter()
|
||||||
|
.table(RpcAccounting::Table)
|
||||||
|
.drop_column(RpcAccounting::Origin)
|
||||||
|
.to_owned(),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
manager
|
manager
|
||||||
.alter_table(
|
.alter_table(
|
||||||
Table::alter()
|
Table::alter()
|
||||||
@ -15,7 +25,7 @@ impl MigrationTrait for Migration {
|
|||||||
.big_unsigned()
|
.big_unsigned()
|
||||||
.null(),
|
.null(),
|
||||||
)
|
)
|
||||||
.add_column_if_not_exists(ColumnDef::new(RpcAccounting::Origin).string().null())
|
.add_column(ColumnDef::new(RpcAccounting::Origin).string().null())
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
Loading…
Reference in New Issue
Block a user