summaryrefslogtreecommitdiff
path: root/animism-align/cli/app/sql/versions/202103051807_make_username_unique.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-03-05 18:08:17 +0100
committerJules Laplace <julescarbon@gmail.com>2021-03-05 18:08:17 +0100
commitd5b6a4ea27f8c905e613363aab365066ad6d9cda (patch)
tree7cbb6a3a94cb9079800023d0bf06f7bd1b1bc55c /animism-align/cli/app/sql/versions/202103051807_make_username_unique.py
parent9893a6e30f8fdbb95fc7066db851579e2a9bfe69 (diff)
auth stuff. generate secret and create user from the cli
Diffstat (limited to 'animism-align/cli/app/sql/versions/202103051807_make_username_unique.py')
-rw-r--r--animism-align/cli/app/sql/versions/202103051807_make_username_unique.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/animism-align/cli/app/sql/versions/202103051807_make_username_unique.py b/animism-align/cli/app/sql/versions/202103051807_make_username_unique.py
new file mode 100644
index 0000000..e8f4985
--- /dev/null
+++ b/animism-align/cli/app/sql/versions/202103051807_make_username_unique.py
@@ -0,0 +1,41 @@
+"""make username unique
+
+Revision ID: 135ba3ff136a
+Revises: 5de5fdfbe69a
+Create Date: 2021-03-05 18:07:36.955364
+
+"""
+from alembic import op
+import sqlalchemy as sa
+import sqlalchemy_utc
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = '135ba3ff136a'
+down_revision = '5de5fdfbe69a'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.alter_column('episode', 'episode_number',
+ existing_type=mysql.INTEGER(),
+ nullable=True)
+ op.alter_column('episode', 'release_date',
+ existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=256),
+ nullable=True)
+ op.create_unique_constraint(None, 'user', ['username'])
+ # ### end Alembic commands ###
+
+
+def downgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.drop_constraint(None, 'user', type_='unique')
+ op.alter_column('episode', 'release_date',
+ existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=256),
+ nullable=False)
+ op.alter_column('episode', 'episode_number',
+ existing_type=mysql.INTEGER(),
+ nullable=False)
+ # ### end Alembic commands ###