mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
remove problematic database index
This commit is contained in:
parent
781694e023
commit
5948650b3a
2 changed files with 2 additions and 8 deletions
|
@ -57,9 +57,9 @@ class Instance(db.Model):
|
|||
last_successful_send = db.Column(db.DateTime) # When we successfully sent them an Activity
|
||||
failures = db.Column(db.Integer, default=0) # How many times we failed to send (reset to 0 after every successful send)
|
||||
most_recent_attempt = db.Column(db.DateTime) # When the most recent failure was
|
||||
dormant = db.Column(db.Boolean, default=False, index=True) # True once this instance is considered offline and not worth sending to any more
|
||||
dormant = db.Column(db.Boolean, default=False) # True once this instance is considered offline and not worth sending to any more
|
||||
start_trying_again = db.Column(db.DateTime) # When to start trying again. Should grow exponentially with each failure.
|
||||
gone_forever = db.Column(db.Boolean, default=False, index=True) # True once this instance is considered offline forever - never start trying again
|
||||
gone_forever = db.Column(db.Boolean, default=False) # True once this instance is considered offline forever - never start trying again
|
||||
ip_address = db.Column(db.String(50))
|
||||
|
||||
posts = db.relationship('Post', backref='instance', lazy='dynamic')
|
||||
|
|
|
@ -29,18 +29,12 @@ def upgrade():
|
|||
batch_op.create_index(batch_op.f('ix_community_topic_id'), ['topic_id'], unique=False)
|
||||
batch_op.create_foreign_key(None, 'topic', ['topic_id'], ['id'])
|
||||
|
||||
with op.batch_alter_table('instance', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_instance_dormant'), ['dormant'], unique=False)
|
||||
batch_op.create_index(batch_op.f('ix_instance_gone_forever'), ['gone_forever'], unique=False)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('instance', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_instance_gone_forever'))
|
||||
batch_op.drop_index(batch_op.f('ix_instance_dormant'))
|
||||
|
||||
with op.batch_alter_table('community', schema=None) as batch_op:
|
||||
batch_op.drop_constraint(None, type_='foreignkey')
|
||||
|
|
Loading…
Reference in a new issue