mirror of
https://github.com/versia-pub/activitypub.git
synced 2026-03-13 02:49:17 +01:00
feat: Refactor migration and follow code
This commit is contained in:
parent
468371d43d
commit
ce5f97ac33
5 changed files with 78 additions and 6 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue