bot/migration/src/m20260210_000004_add_cron_column.rs
2026-02-10 19:51:20 +01:00

35 lines
855 B
Rust

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(Tasks::Table)
.add_column(ColumnDef::new(Tasks::Cron).string().null())
.to_owned(),
)
.await
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(Tasks::Table)
.drop_column(Tasks::Cron)
.to_owned(),
)
.await
}
}
#[derive(DeriveIden)]
enum Tasks {
Table,
Cron,
}