text: """empty message
  
  Revision ID: b6865f8517d9
  Revises: 
  Create Date: 2021-02-20 21:08:52.878322
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = 'b6865f8517d9'
  down_revision = None
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table('roles',
      sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
      sa.Column('name', sa.Text(), nullable=False),
      sa.PrimaryKeyConstraint('id'),
      sa.UniqueConstraint('name')
      )
      op.create_table('users',
      sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
      sa.Column('is_active', sa.Boolean(), server_default='0', nullable=False),
      sa.Column('created', sa.DateTime(timezone=True), nullable=False),
      sa.Column('username', sa.Text(), nullable=False),
      sa.Column('password', sa.Text(), nullable=False),
      sa.Column('api_key', sa.Text(), nullable=False),
      sa.PrimaryKeyConstraint('id'),
      sa.UniqueConstraint('api_key'),
      sa.UniqueConstraint('username')
      )
      op.create_table('user_roles',
      sa.Column('user_id', sa.Integer(), nullable=False),
      sa.Column('role_id', sa.Integer(), nullable=False),
      sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ondelete='CASCADE'),
      sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
      sa.PrimaryKeyConstraint('user_id', 'role_id')
      )
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_table('user_roles')
      op.drop_table('users')
      op.drop_table('roles')
      # ### end Alembic commands ###
  