Update migrations and homepage for 2025
This commit is contained in:
parent
c73184060c
commit
b0a1e142cd
4 changed files with 46 additions and 3 deletions
|
@ -23,8 +23,10 @@ gr = AppGroup("user")
|
|||
@click.option("--school", prompt=True)
|
||||
@click.option("--phone", prompt=True)
|
||||
@click.option("--gender", prompt=True)
|
||||
@click.option("--country", prompt=True)
|
||||
@click.option("--age", prompt=True)
|
||||
def create_user(email, first_name, last_name, password, school, phone, gender,
|
||||
admin):
|
||||
admin,age, country):
|
||||
"""
|
||||
Creates a user
|
||||
"""
|
||||
|
@ -48,7 +50,9 @@ def create_user(email, first_name, last_name, password, school, phone, gender,
|
|||
school=school,
|
||||
phone=phone,
|
||||
gender=gender,
|
||||
is_admin=admin
|
||||
is_admin=admin,
|
||||
country=country,
|
||||
age=age
|
||||
)
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a107d4daf149bac2b8bd1182b399e57e8171c1f8
|
||||
Subproject commit 4ae1dc34eda89acd3913f63ccdb760e958063112
|
38
migrations/versions/f5b70c6e73eb_.py
Normal file
38
migrations/versions/f5b70c6e73eb_.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: f5b70c6e73eb
|
||||
Revises: 858e0d45876f
|
||||
Create Date: 2024-10-31 13:04:48.500263
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f5b70c6e73eb'
|
||||
down_revision = '858e0d45876f'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('user', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('newsletter', sa.Boolean(), nullable=False))
|
||||
batch_op.add_column(sa.Column('country', sa.String(), nullable=False))
|
||||
batch_op.add_column(sa.Column('age', sa.Integer(), nullable=False))
|
||||
batch_op.add_column(sa.Column('dietary_restrictions', sa.String(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('user', schema=None) as batch_op:
|
||||
batch_op.drop_column('dietary_restrictions')
|
||||
batch_op.drop_column('age')
|
||||
batch_op.drop_column('country')
|
||||
batch_op.drop_column('newsletter')
|
||||
|
||||
# ### end Alembic commands ###
|
|
@ -26,3 +26,4 @@ ulid
|
|||
bootstrap-flask
|
||||
Font-Awesome-Flask
|
||||
tabulate
|
||||
markupsafe
|
||||
|
|
Loading…
Add table
Reference in a new issue