mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Remove full description from search index
This commit is contained in:
parent
7bfb183578
commit
90710cc8b9
@ -385,7 +385,7 @@ class Package(db.Model):
|
||||
name_valid = db.CheckConstraint("name ~* '^[a-z0-9_]+$' AND name != '_game'")
|
||||
|
||||
search_vector = db.Column(TSVectorType("name", "title", "short_desc", "desc",
|
||||
weights={ "name": "A", "title": "B", "short_desc": "C", "desc": "D" }))
|
||||
weights={ "name": "A", "title": "B", "short_desc": "C" }))
|
||||
|
||||
license_id = db.Column(db.Integer, db.ForeignKey("license.id"), nullable=False, default=1)
|
||||
license = db.relationship("License", foreign_keys=[license_id])
|
||||
|
32
migrations/versions/16eb610b7751_.py
Normal file
32
migrations/versions/16eb610b7751_.py
Normal file
@ -0,0 +1,32 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 16eb610b7751
|
||||
Revises: 76ff303f76d8
|
||||
Create Date: 2022-09-14 21:10:40.126876
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
from sqlalchemy_searchable import sync_trigger
|
||||
|
||||
revision = '16eb610b7751'
|
||||
down_revision = '76ff303f76d8'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
conn = op.get_bind()
|
||||
|
||||
options = {"weights": {"name": "A", "title": "B", "short_desc": "C"}}
|
||||
sync_trigger(conn, 'package', 'search_vector', ["name", "title", "short_desc"], options=options)
|
||||
|
||||
|
||||
def downgrade():
|
||||
conn = op.get_bind()
|
||||
|
||||
options = {"weights": {"name": "A", "title": "B", "short_desc": "C", "desc": "D"}}
|
||||
sync_trigger(conn, 'package', 'search_vector', ["name", "title", "short_desc", "desc"], options=options)
|
Loading…
Reference in New Issue
Block a user