feat: Refactor migration and follow code

This commit is contained in:
aprilthepink 2024-05-05 17:05:09 +02:00
parent 468371d43d
commit ce5f97ac33
5 changed files with 78 additions and 6 deletions

View file

@ -8,7 +8,6 @@ pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
@ -21,8 +20,16 @@ impl MigrationTrait for Migration {
.auto_increment()
.primary_key(),
)
.col(ColumnDef::new(FollowRelation::FolloweeId).string().not_null())
.col(ColumnDef::new(FollowRelation::FollowerId).string().not_null())
.col(
ColumnDef::new(FollowRelation::FolloweeId)
.string()
.not_null(),
)
.col(
ColumnDef::new(FollowRelation::FollowerId)
.string()
.not_null(),
)
.col(ColumnDef::new(FollowRelation::FolloweeHost).string())
.col(ColumnDef::new(FollowRelation::FollowerHost).string())
.col(ColumnDef::new(FollowRelation::FolloweeInbox).string())
@ -62,5 +69,5 @@ enum FollowRelation {
FolloweeHost,
FollowerHost,
FolloweeInbox,
FollowerInbox
FollowerInbox,
}