Merge branch 'master' into celery-jobs

This commit is contained in:
Martyn Inglis
2016-02-25 12:06:53 +00:00
15 changed files with 328 additions and 2 deletions

View File

@@ -0,0 +1,42 @@
"""empty message
Revision ID: 0022_add_invite_users
Revises: 0021_add_job_metadata
Create Date: 2016-02-23 16:41:40.481468
"""
# revision identifiers, used by Alembic.
revision = '0022_add_invite_users'
down_revision = '0021_add_job_metadata'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('invited_users',
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('email_address', sa.String(length=255), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('service_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('_token', sa.String(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('status', sa.Enum('pending', 'accepted', 'cancelled', name='invited_users_status_types'), nullable=False),
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_invited_users_service_id'), 'invited_users', ['service_id'], unique=False)
op.create_index(op.f('ix_invited_users_user_id'), 'invited_users', ['user_id'], unique=False)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_invited_users_user_id'), table_name='invited_users')
op.drop_index(op.f('ix_invited_users_service_id'), table_name='invited_users')
op.drop_table('invited_users')
op.execute('DROP TYPE invited_users_status_types')
### end Alembic commands ###

View File

@@ -0,0 +1,26 @@
"""empty message
Revision ID: 0023_drop_token
Revises: 0022_add_invite_users
Create Date: 2016-02-24 13:58:04.440296
"""
# revision identifiers, used by Alembic.
revision = '0023_drop_token'
down_revision = '0022_add_invite_users'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column('invited_users', '_token')
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('invited_users', sa.Column('_token', sa.VARCHAR(), autoincrement=False, nullable=False))
### end Alembic commands ###