summaryrefslogtreecommitdiff
path: root/alembic/versions/7fb31859972f_add_revision_table.py
diff options
context:
space:
mode:
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