feat: meow meow akkoma?

This commit is contained in:
aprilthepink 2024-06-27 05:13:38 +02:00
parent cd6ff024e4
commit dc4afd8411
13 changed files with 163 additions and 11 deletions

View file

@ -4,6 +4,7 @@ mod m20220101_000001_post_table;
mod m20240417_230111_user_table;
mod m20240417_233430_post_user_keys;
mod m20240505_002524_user_follow_relation;
mod m20240626_030922_store_ap_json_in_posts;
pub struct Migrator;
@ -15,6 +16,7 @@ impl MigratorTrait for Migrator {
Box::new(m20240417_230111_user_table::Migration),
Box::new(m20240417_233430_post_user_keys::Migration),
Box::new(m20240505_002524_user_follow_relation::Migration),
Box::new(m20240626_030922_store_ap_json_in_posts::Migration),
]
}
}

View file

@ -0,0 +1,35 @@
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(Post::Table)
.add_column_if_not_exists(ColumnDef::new(Post::ApJson).string())
.to_owned(),
)
.await
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(Post::Table)
.drop_column(Post::ApJson)
.to_owned(),
)
.await
}
}
#[derive(DeriveIden)]
pub enum Post {
Table,
ApJson,
}