mirror of
https://github.com/versia-pub/activitypub.git
synced 2026-03-13 02:49:17 +01:00
feat: meow meow akkoma?
This commit is contained in:
parent
cd6ff024e4
commit
dc4afd8411
13 changed files with 163 additions and 11 deletions
|
|
@ -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),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
35
migration/src/m20240626_030922_store_ap_json_in_posts.rs
Normal file
35
migration/src/m20240626_030922_store_ap_json_in_posts.rs
Normal 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,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue