text: """organizational tables
  
  Revision ID: 8d7458f5e4b0
  Revises: 864f14b5cf84
  Create Date: 2022-02-09 21:44:24.441946
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = '8d7458f5e4b0'
  down_revision = '864f14b5cf84'
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table('class',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.PrimaryKeyConstraint('id')
      )
      op.create_table('student_class',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('user_id', sa.Integer(), nullable=True),
      sa.Column('class_id', sa.Integer(), nullable=True),
      sa.ForeignKeyConstraint(['class_id'], ['class.id'], ),
      sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
      sa.PrimaryKeyConstraint('id')
      )
      op.create_table('teacher_class',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('user_id', sa.Integer(), nullable=True),
      sa.Column('class_id', sa.Integer(), nullable=True),
      sa.ForeignKeyConstraint(['class_id'], ['class.id'], ),
      sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
      sa.PrimaryKeyConstraint('id')
      )
      op.add_column('user', sa.Column('username', sa.String(length=100), nullable=True))
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_column('user', 'username')
      op.drop_table('teacher_class')
      op.drop_table('student_class')
      op.drop_table('class')
      # ### end Alembic commands ###
  