summaryrefslogtreecommitdiff
path: root/alembic/versions/f60bfe68b20f_add_other_posts_columns.py
diff options
context:
space:
mode:
Diffstat (limited to 'alembic/versions/f60bfe68b20f_add_other_posts_columns.py')
-rw-r--r--alembic/versions/f60bfe68b20f_add_other_posts_columns.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/alembic/versions/f60bfe68b20f_add_other_posts_columns.py b/alembic/versions/f60bfe68b20f_add_other_posts_columns.py
new file mode 100644
index 0000000..0f2c369
--- /dev/null
+++ b/alembic/versions/f60bfe68b20f_add_other_posts_columns.py
@@ -0,0 +1,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