Skip to content

Commit

Permalink
init database state
Browse files Browse the repository at this point in the history
  • Loading branch information
xen committed Jul 12, 2014
1 parent 1137b31 commit 3d51b29
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ setup: venv/bin/activate requirements.txt
. venv/bin/activate; pip install -Ur requirements.txt
cd static && bower install

init: venv/bin/activate requirements.txt
. venv/bin/activate; python manage.py db upgrade

babel: venv/bin/activate
. venv/bin/activate; pybabel extract -F babel.cfg -o project/translations/messages.pot project

Expand Down
81 changes: 81 additions & 0 deletions migrations/versions/ee69294e63e_init_state.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""init state
Revision ID: ee69294e63e
Revises: None
Create Date: 2014-07-12 03:54:08.227618
"""

# revision identifiers, used by Alembic.
revision = 'ee69294e63e'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('social_auth_code',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(length=200), nullable=True),
sa.Column('code', sa.String(length=32), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('code', 'email')
)
op.create_index(op.f('ix_social_auth_code_code'), 'social_auth_code', ['code'], unique=False)
op.create_table('social_auth_nonce',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('server_url', sa.String(length=255), nullable=True),
sa.Column('timestamp', sa.Integer(), nullable=True),
sa.Column('salt', sa.String(length=40), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('server_url', 'timestamp', 'salt')
)
op.create_table('social_auth_association',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('server_url', sa.String(length=255), nullable=True),
sa.Column('handle', sa.String(length=255), nullable=True),
sa.Column('secret', sa.String(length=255), nullable=True),
sa.Column('issued', sa.Integer(), nullable=True),
sa.Column('lifetime', sa.Integer(), nullable=True),
sa.Column('assoc_type', sa.String(length=64), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('server_url', 'handle')
)
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=200), nullable=True),
sa.Column('password', sa.String(length=200), nullable=True),
sa.Column('name', sa.String(length=100), nullable=True),
sa.Column('email', sa.String(length=200), nullable=True),
sa.Column('active', sa.Boolean(), nullable=True),
sa.Column('ui_lang', sa.String(length=2), nullable=True),
sa.Column('url', sa.String(length=200), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('username')
)
op.create_table('social_auth_usersocialauth',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('provider', sa.String(length=32), nullable=True),
sa.Column('uid', sa.String(length=255), nullable=True),
sa.Column('extra_data', sa.PickleType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], [u'users.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('provider', 'uid')
)
op.create_index(op.f('ix_social_auth_usersocialauth_user_id'), 'social_auth_usersocialauth', ['user_id'], unique=False)
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_social_auth_usersocialauth_user_id'), table_name='social_auth_usersocialauth')
op.drop_table('social_auth_usersocialauth')
op.drop_table('users')
op.drop_table('social_auth_association')
op.drop_table('social_auth_nonce')
op.drop_index(op.f('ix_social_auth_code_code'), table_name='social_auth_code')
op.drop_table('social_auth_code')
### end Alembic commands ###

0 comments on commit 3d51b29

Please sign in to comment.