12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- """empty message
- Revision ID: 83da20f4d7a
- Revises: None
- Create Date: 2015-04-17 11:10:22.330758
- """
- # revision identifiers, used by Alembic.
- revision = '83da20f4d7a'
- down_revision = 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=255), nullable=False),
- sa.Column('description', sa.String(length=255), nullable=False),
- sa.PrimaryKeyConstraint('id'),
- sa.UniqueConstraint('name')
- )
- op.create_table('thingy',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('image', sa.String(length=255), nullable=False),
- sa.Column('image_storage_type', sa.String(length=255), nullable=False),
- sa.Column('image_storage_bucket_name', sa.String(length=255), nullable=False),
- sa.PrimaryKeyConstraint('id')
- )
- op.create_table('user',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('email', sa.String(length=255), nullable=False),
- sa.Column('password', sa.String(length=255), nullable=False),
- sa.PrimaryKeyConstraint('id'),
- sa.UniqueConstraint('email')
- )
- op.create_table('roles_users',
- sa.Column('user_id', sa.Integer(), nullable=True),
- sa.Column('role_id', sa.Integer(), nullable=True),
- sa.ForeignKeyConstraint(['role_id'], ['role.id'], ),
- sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
- )
- ### end Alembic commands ###
- def downgrade():
- ### commands auto generated by Alembic - please adjust! ###
- op.drop_table('roles_users')
- op.drop_table('user')
- op.drop_table('thingy')
- op.drop_table('role')
- ### end Alembic commands ###
|