mirror of
https://github.com/versia-pub/activitypub.git
synced 2025-12-06 14:48:19 +01:00
36 lines
867 B
Rust
36 lines
867 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(User::Table)
|
|
.add_column_if_not_exists(ColumnDef::new(User::ApJson).string())
|
|
.to_owned(),
|
|
)
|
|
.await
|
|
}
|
|
|
|
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
|
manager
|
|
.alter_table(
|
|
Table::alter()
|
|
.table(User::Table)
|
|
.drop_column(User::ApJson)
|
|
.to_owned(),
|
|
)
|
|
.await
|
|
}
|
|
}
|
|
|
|
#[derive(DeriveIden)]
|
|
pub enum User {
|
|
Table,
|
|
ApJson,
|
|
}
|