mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-17 06:48:36 +02:00
Drop original_url column from Topic
This isn't being used for anything, might as well get rid of the cruft.
This commit is contained in:
@@ -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))
|
||||
@@ -145,7 +145,6 @@ class DataCleaner:
|
||||
"markdown": DEFAULT,
|
||||
"rendered_html": DEFAULT,
|
||||
"link": DEFAULT,
|
||||
"original_url": DEFAULT,
|
||||
"content_metadata": DEFAULT,
|
||||
"_tags": DEFAULT,
|
||||
},
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user