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(
Table::alter()
.table(Topics::Table)
.add_column(ColumnDef::new(Topics::DeletedAt).timestamp_with_time_zone().null())
.add_column(ColumnDef::new(Topics::DeletedById).uuid().null())
.to_owned(),
)
.await
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(Topics::Table)
.drop_column(Topics::DeletedAt)
.drop_column(Topics::DeletedById)
.to_owned(),
)
.await
}
}
#[derive(DeriveIden)]
enum Topics {
Table,
DeletedAt,
DeletedById,
}
neiam
/recourse
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
1.0 KiB · text
History
263b40b