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/7fb31859972f_add_revision_table.py | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 alembic/versions/7fb31859972f_add_revision_table.py (limited to 'alembic/versions/7fb31859972f_add_revision_table.py') diff --git a/alembic/versions/7fb31859972f_add_revision_table.py b/alembic/versions/7fb31859972f_add_revision_table.py new file mode 100644 index 0000000..440e695 --- /dev/null +++ b/alembic/versions/7fb31859972f_add_revision_table.py @@ -0,0 +1,33 @@ +"""add revision table + +Revision ID: 7fb31859972f +Revises: f18f4db81d80 +Create Date: 2022-02-24 02:14:33.592965 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '7fb31859972f' +down_revision = 'f18f4db81d80' +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_table("users", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("email", sa.String(), nullable=False), + sa.Column("password", sa.String(), nullable=False), + sa.Column("created_at", sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("email") + ) + pass + + +def downgrade(): + op.drop_table("users") + pass -- cgit v1.2.3