Browse Source

Drop original_url column from Topic

This isn't being used for anything, might as well get rid of the cruft.
merge-requests/85/head
Deimos 5 years ago
parent
commit
c59be2ea64
  1. 24
      tildes/alembic/versions/8326f8cc5ddd_topic_drop_original_url_column.py
  2. 1
      tildes/scripts/clean_private_data.py
  3. 2
      tildes/tildes/models/topic/topic.py

24
tildes/alembic/versions/8326f8cc5ddd_topic_drop_original_url_column.py

@ -0,0 +1,24 @@
"""Topic: drop original_url column
Revision ID: 8326f8cc5ddd
Revises: 20b5f07e5f80
Create Date: 2019-10-05 00:52:20.515858
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "8326f8cc5ddd"
down_revision = "20b5f07e5f80"
branch_labels = None
depends_on = None
def upgrade():
op.drop_column("topics", "original_url")
def downgrade():
op.add_column("topics", sa.Column("original_url", sa.Text(), nullable=True))

1
tildes/scripts/clean_private_data.py

@ -145,7 +145,6 @@ class DataCleaner:
"markdown": DEFAULT,
"rendered_html": DEFAULT,
"link": DEFAULT,
"original_url": DEFAULT,
"content_metadata": DEFAULT,
"_tags": DEFAULT,
},

2
tildes/tildes/models/topic/topic.py

@ -116,7 +116,6 @@ class Topic(DatabaseModel):
_markdown: Optional[str] = deferred(Column("markdown", Text))
rendered_html: Optional[str] = Column(Text)
link: Optional[str] = Column(Text)
original_url: Optional[str] = Column(Text)
content_metadata: Dict[str, Any] = Column(
MutableDict.as_mutable(JSONB(none_as_null=True))
)
@ -229,7 +228,6 @@ class Topic(DatabaseModel):
new_topic = cls._create_base_topic(group, author, title)
new_topic.topic_type = TopicType.LINK
new_topic.link = link
new_topic.original_url = link
incr_counter("topics", type="link")

Loading…
Cancel
Save