From 3ce694bbebb9c24606e83f8923ca8055b7c9c63d Mon Sep 17 00:00:00 2001 From: Rasmus Luha Date: Thu, 24 Feb 2022 02:57:29 +0200 Subject: Added Alembic stuff --- .../versions/19d57d527c14_create_posts_table.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 alembic/versions/19d57d527c14_create_posts_table.py (limited to 'alembic/versions/19d57d527c14_create_posts_table.py') diff --git a/alembic/versions/19d57d527c14_create_posts_table.py b/alembic/versions/19d57d527c14_create_posts_table.py new file mode 100644 index 0000000..8550646 --- /dev/null +++ b/alembic/versions/19d57d527c14_create_posts_table.py @@ -0,0 +1,27 @@ +"""create posts table + +Revision ID: 19d57d527c14 +Revises: +Create Date: 2022-02-24 01:18:04.684095 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '19d57d527c14' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_table("posts", sa.Column('id', sa.Integer(), nullable=False, primary_key=True ), + sa.Column("title", sa.String(), nullable=False) ) + pass + + +def downgrade(): + op.drop_table('posts') + pass -- cgit v1.2.3