-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0e4bc3
commit 6481470
Showing
7 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
use sea_orm_migration::prelude::*; | ||
|
||
#[derive(DeriveMigrationName)] | ||
pub struct Migration; | ||
|
||
#[async_trait::async_trait] | ||
impl MigrationTrait for Migration { | ||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.alter_table( | ||
sea_query::Table::alter() | ||
.table(asset_data::Entity) | ||
.add_column(ColumnDef::new(Alias::new("raw_name")).binary()) | ||
.to_owned(), | ||
) | ||
.await?; | ||
manager | ||
.alter_table( | ||
sea_query::Table::alter() | ||
.table(asset_data::Entity) | ||
.add_column(ColumnDef::new(Alias::new("raw_symbol")).binary()) | ||
.to_owned(), | ||
) | ||
.await?; | ||
Ok(()) | ||
} | ||
|
||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.alter_table( | ||
sea_query::Table::alter() | ||
.table(asset_data::Entity) | ||
.drop_column(Alias::new("raw_name")) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
manager | ||
.alter_table( | ||
sea_query::Table::alter() | ||
.table(asset_data::Entity) | ||
.drop_column(Alias::new("raw_symbol")) | ||
.to_owned(), | ||
) | ||
.await?; | ||
Ok(()) | ||
} | ||
} | ||
|
||
/// Learn more at https://docs.rs/sea-query#iden | ||
#[derive(Iden)] | ||
enum Post { | ||
Table, | ||
Id, | ||
Title, | ||
Text, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters