mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
indexible fields - controls external search
This commit is contained in:
parent
29c7720985
commit
9905680041
2 changed files with 46 additions and 0 deletions
|
@ -84,6 +84,7 @@ class User(UserMixin, db.Model):
|
|||
stripe_customer_id = db.Column(db.String(50))
|
||||
stripe_subscription_id = db.Column(db.String(50))
|
||||
searchable = db.Column(db.Boolean, default=True)
|
||||
indexable = db.Column(db.Boolean, default=False)
|
||||
|
||||
ap_id = db.Column(db.String(255), index=True)
|
||||
ap_profile_id = db.Column(db.String(255))
|
||||
|
@ -181,6 +182,7 @@ class Post(db.Model):
|
|||
nsfw = db.Column(db.Boolean, default=False)
|
||||
nsfl = db.Column(db.Boolean, default=False)
|
||||
sticky = db.Column(db.Boolean, default=False)
|
||||
indexable = db.Column(db.Boolean, default=False)
|
||||
created_at = db.Column(db.DateTime, index=True, default=datetime.utcnow)
|
||||
posted_at = db.Column(db.DateTime, index=True, default=datetime.utcnow)
|
||||
last_active = db.Column(db.DateTime, index=True, default=datetime.utcnow)
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
"""indexable fields - controls external search
|
||||
|
||||
Revision ID: f52c490d4e81
|
||||
Revises: e8fe5eff9532
|
||||
Create Date: 2023-08-26 13:09:31.328816
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f52c490d4e81'
|
||||
down_revision = 'e8fe5eff9532'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('community', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_community_ap_profile_id'), ['ap_profile_id'], unique=False)
|
||||
|
||||
with op.batch_alter_table('post', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('indexable', sa.Boolean(), nullable=True))
|
||||
|
||||
with op.batch_alter_table('user', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('indexable', sa.Boolean(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('user', schema=None) as batch_op:
|
||||
batch_op.drop_column('indexable')
|
||||
|
||||
with op.batch_alter_table('post', schema=None) as batch_op:
|
||||
batch_op.drop_column('indexable')
|
||||
|
||||
with op.batch_alter_table('community', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_community_ap_profile_id'))
|
||||
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue