From 808d4b662141f787b647a0f3a4e40e82fc4c7348 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Mon, 31 Aug 2015 10:55:05 +0200 Subject: [PATCH] Add user model. --- .../versions/1232daf66ac_add_user_support.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 migrations/versions/1232daf66ac_add_user_support.py diff --git a/migrations/versions/1232daf66ac_add_user_support.py b/migrations/versions/1232daf66ac_add_user_support.py new file mode 100644 index 0000000..bbc6bbb --- /dev/null +++ b/migrations/versions/1232daf66ac_add_user_support.py @@ -0,0 +1,34 @@ +"""Add user support. + +Revision ID: 1232daf66ac +Revises: 144929e0f5f +Create Date: 2015-08-31 10:24:40.578432 + +""" + +# revision identifiers, used by Alembic. +revision = '1232daf66ac' +down_revision = '144929e0f5f' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.create_table('user', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('email', sa.String(length=200), nullable=False), + sa.Column('password', sa.String(length=100), nullable=True), + sa.Column('active', sa.Boolean(), server_default=sa.text('true'), nullable=False), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True) + ### end Alembic commands ### + + +def downgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.drop_index(op.f('ix_user_email'), table_name='user') + op.drop_table('user') + ### end Alembic commands ###