diff --git a/alembic/versions/2023_03_19_1509-caf39c6e55fc_in_out_models.py b/alembic/versions/2023_03_19_1509-caf39c6e55fc_in_out_models.py index fc759e4..e526d36 100644 --- a/alembic/versions/2023_03_19_1509-caf39c6e55fc_in_out_models.py +++ b/alembic/versions/2023_03_19_1509-caf39c6e55fc_in_out_models.py @@ -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') diff --git a/app/models.py b/app/models.py index 3b8029f..1d53035 100644 --- a/app/models.py +++ b/app/models.py @@ -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"),