mirror of
https://github.com/versia-pub/activitypub.git
synced 2026-03-13 02:49:17 +01:00
feat: add missing fields on AP users
This commit is contained in:
parent
692e4bff22
commit
1a741c6420
8 changed files with 300 additions and 39 deletions
|
|
@ -5,6 +5,7 @@ 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;
|
||||
mod m20240719_235452_user_ap_column;
|
||||
|
||||
pub struct Migrator;
|
||||
|
||||
|
|
@ -17,6 +18,7 @@ impl MigratorTrait for Migrator {
|
|||
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),
|
||||
Box::new(m20240719_235452_user_ap_column::Migration),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
35
migration/src/m20240719_235452_user_ap_column.rs
Normal file
35
migration/src/m20240719_235452_user_ap_column.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(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,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue