Skip to content

Commit

Permalink
WCM-291: Add forgotten date_last_modified column
Browse files Browse the repository at this point in the history
  • Loading branch information
wosc committed Sep 27, 2024
1 parent 085cba1 commit bf9caa1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/docs/changelog/WCM-291.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WCM-291: Add forgotten date_last_modified column
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""add modified column
(was forgotten in b7304b8f2b06)
Revision ID: 28355ecfa735
Revises: b7304b8f2b06
Create Date: 2024-09-26 11:50:35.942786
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '28355ecfa735'
down_revision: Union[str, None] = 'b7304b8f2b06'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.add_column(
'properties', sa.Column('date_last_modified', sa.TIMESTAMP(timezone=True), nullable=True)
)


def downgrade() -> None:
op.drop_column('properties', 'date_last_modified')
4 changes: 4 additions & 0 deletions core/src/zeit/connector/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class Modified:
TIMESTAMP,
info={'namespace': 'document', 'name': 'date_last_checkout'},
)
date_last_modified = mapped_column(
TIMESTAMP,
info={'namespace': 'document', 'name': 'date_last_modified'},
)


class PublishInfo:
Expand Down

0 comments on commit bf9caa1

Please sign in to comment.