summaryrefslogtreecommitdiff
path: root/alembic/versions/f60bfe68b20f_add_other_posts_columns.py
blob: 0f2c369c2f40a332f1ea97addebc0c08302566c4 (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
"""add other posts columns

Revision ID: f60bfe68b20f
Revises: e68b0c5f7380
Create Date: 2022-02-24 02:26:37.946997

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f60bfe68b20f'
down_revision = 'e68b0c5f7380'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column("posts", sa.Column("published", sa.Boolean(), nullable=False,
                        server_default="TRUE"),)
    op.add_column("posts", sa.Column("created_at", sa.TIMESTAMP(timezone=True), nullable=False,
                        server_default=sa.text("NOW()")),)
    pass


def downgrade():
    op.drop_column("posts", "published")
    op.drop_column("posts", "created_at")
    pass