db/update models

This commit is contained in:
SouthFox 2023-03-20 21:51:30 +08:00
parent 209817451c
commit ce426a20c2
2 changed files with 3 additions and 0 deletions

View file

@ -33,9 +33,11 @@ def upgrade() -> None:
sa.Column('ap_object', sa.JSON(), nullable=False),
sa.Column('activity_object_ap_id', sa.String(), nullable=True),
sa.Column('visibility', sa.Enum('PUBLIC', 'UNLISTED', 'FOLLOWERS_ONLY', 'DIRECT', name='visibilityenum'), nullable=False),
sa.Column('undo_id', sa.Integer(), nullable=False),
sa.Column('relates_to_inbox_object_id', sa.Integer(), nullable=True),
sa.Column('relates_to_outbox_object_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['actor_id'], ['actor.id'], ),
sa.ForeignKeyConstraint(['undo_id'], ['inbox.id'], ),
sa.ForeignKeyConstraint(['relates_to_inbox_object_id'], ['inbox.id'], ),
sa.ForeignKeyConstraint(['relates_to_outbox_object_id'], ['outbox.id'], ),
sa.PrimaryKeyConstraint('id')

View file

@ -65,6 +65,7 @@ class InboxObject(Base):
visibility = Column(Enum(ap.VisibilityEnum), nullable=False)
undo_id = Column(Integer, ForeignKey("inbox.id"), nullable=True)
relates_to_inbox_object_id = Column(
Integer,
ForeignKey("inbox.id"),