Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated user auth seems functional. Data migration done manually v…
…ia csv export/import.
- Loading branch information
Showing
5 changed files
with
84 additions
and
38 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
alembic/versions/3badcc784860_add_user_auth_models_to_primary_db.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
"""Add user auth models to primary db | ||
Revision ID: 3badcc784860 | ||
Revises: 4e622fb65953 | ||
Create Date: 2016-01-15 10:09:31.464087 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '3badcc784860' | ||
down_revision = '4e622fb65953' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('Role', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('name', sa.String(length=50), nullable=True), | ||
sa.Column('description', sa.String(length=255), nullable=True), | ||
sa.PrimaryKeyConstraint('id'), | ||
sa.UniqueConstraint('name') | ||
) | ||
op.create_table('User', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('email', sa.String(length=255), nullable=False), | ||
sa.Column('confirmed_at', sa.DateTime(), nullable=True), | ||
sa.Column('is_active', sa.Boolean(), server_default='0', nullable=False), | ||
sa.Column('full_name', sa.String(length=50), server_default='', nullable=False), | ||
sa.PrimaryKeyConstraint('id'), | ||
sa.UniqueConstraint('email') | ||
) | ||
op.create_table('UserAuth', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('user_id', sa.Integer(), nullable=True), | ||
sa.Column('username', sa.String(length=50), nullable=False), | ||
sa.Column('password', sa.String(length=255), server_default='', nullable=False), | ||
sa.Column('reset_password_token', sa.String(length=100), server_default='', nullable=False), | ||
sa.Column('active', sa.Boolean(), server_default='0', nullable=False), | ||
sa.ForeignKeyConstraint(['user_id'], ['User.id'], ondelete='CASCADE'), | ||
sa.PrimaryKeyConstraint('id'), | ||
sa.UniqueConstraint('username') | ||
) | ||
op.create_table('UserRoles', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('user_id', sa.Integer(), nullable=True), | ||
sa.Column('role_id', sa.Integer(), nullable=True), | ||
sa.ForeignKeyConstraint(['role_id'], ['Role.id'], ondelete='CASCADE'), | ||
sa.ForeignKeyConstraint(['user_id'], ['User.id'], ondelete='CASCADE'), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('UserRoles') | ||
op.drop_table('UserAuth') | ||
op.drop_table('User') | ||
op.drop_table('Role') | ||
### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.