aboutsummaryrefslogtreecommitdiff
path: root/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py
blob: bd7ccf58958da0f6ece2959c180cdeb70cfdadf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""changed the type of the column 'last_modified' to string.

Revision ID: 17dcb75f3fe
Revises: cde34831ea
Create Date: 2015-03-10 14:20:53.676344

"""
# revision identifiers, used by Alembic.
from datetime import datetime

import sqlalchemy as sa
from alembic import op

revision = "17dcb75f3fe"
down_revision = "cde34831ea"


def upgrade():
    unix_start = datetime(1970, 1, 1)
    op.drop_column("feed", "last_modified")
    op.add_column(
        "feed",
        sa.Column(
            "last_modified",
            sa.String(),
            nullable=True,
            default=unix_start,
            server_default=str(unix_start),
        ),
    )
bgstack15