summaryrefslogtreecommitdiff
path: root/alembic/versions/7fb31859972f_add_revision_table.py
diff options
context:
space:
mode:
authorRasmus Luha <rasmus.luha@gmail.com>2022-02-24 02:57:29 +0200
committerRasmus Luha <rasmus.luha@gmail.com>2022-02-24 02:57:29 +0200
commit3ce694bbebb9c24606e83f8923ca8055b7c9c63d (patch)
tree79bdc75a28eadabb18fb65978f0dec914eea546d /alembic/versions/7fb31859972f_add_revision_table.py
parentf1ab105a7620160c16d7c91bdf3ca1cff6deef7c (diff)
Added Alembic stuff
Diffstat (limited to 'alembic/versions/7fb31859972f_add_revision_table.py')
-rw-r--r--alembic/versions/7fb31859972f_add_revision_table.py33
1 files changed, 33 insertions, 0 deletions
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