diff --git a/goathacks/cli.py b/goathacks/cli.py index e4a56ba..a87b506 100644 --- a/goathacks/cli.py +++ b/goathacks/cli.py @@ -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() diff --git a/goathacks/templates/home b/goathacks/templates/home index a107d4d..4ae1dc3 160000 --- a/goathacks/templates/home +++ b/goathacks/templates/home @@ -1 +1 @@ -Subproject commit a107d4daf149bac2b8bd1182b399e57e8171c1f8 +Subproject commit 4ae1dc34eda89acd3913f63ccdb760e958063112 diff --git a/migrations/versions/f5b70c6e73eb_.py b/migrations/versions/f5b70c6e73eb_.py new file mode 100644 index 0000000..42d0b86 --- /dev/null +++ b/migrations/versions/f5b70c6e73eb_.py @@ -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 ### diff --git a/requirements.txt b/requirements.txt index ded699a..c638071 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,3 +26,4 @@ ulid bootstrap-flask Font-Awesome-Flask tabulate +markupsafe