text: """Add talk schedule.
  
  Revision ID: 37c84eaa437
  Revises: 3bda3a710eb
  Create Date: 2014-08-01 21:26:10.030252
  
  """
  
  # revision identifiers, used by Alembic.
  revision = '37c84eaa437'
  down_revision = '3bda3a710eb'
  
  from alembic import op
  import sqlalchemy as sa
  
  
  def upgrade():
      ### commands auto generated by Alembic - please adjust! ###
      op.create_table('rooms',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('name', sa.String(length=255), nullable=False),
      sa.Column('order', sa.Integer(), nullable=False),
      sa.PrimaryKeyConstraint('id')
      )
      op.create_table('days',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('date', sa.Date(), nullable=True),
      sa.Column('event_id', sa.Integer(), nullable=False),
      sa.ForeignKeyConstraint(['event_id'], ['events.id'], ),
      sa.PrimaryKeyConstraint('id')
      )
      op.create_table('slots',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('kind', sa.Enum('break', 'meal', 'keynote', 'talk', 'tutorial', name='slotkind'), nullable=False),
      sa.Column('content_override', sa.Text(), nullable=True),
      sa.Column('start', sa.Time(), nullable=False),
      sa.Column('end', sa.Time(), nullable=False),
      sa.Column('day_id', sa.Integer(), nullable=False),
      sa.ForeignKeyConstraint(['day_id'], ['days.id'], ),
      sa.PrimaryKeyConstraint('id')
      )
      op.create_table('presentations',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('slot_id', sa.Integer(), nullable=False),
      sa.Column('talk_id', sa.Integer(), nullable=True),
      sa.ForeignKeyConstraint(['slot_id'], ['slots.id'], ),
      sa.ForeignKeyConstraint(['talk_id'], ['talks.id'], ),
      sa.PrimaryKeyConstraint('id')
      )
      op.create_table('rooms_slots',
      sa.Column('slot_id', sa.Integer(), nullable=True),
      sa.Column('room_id', sa.Integer(), nullable=True),
      sa.ForeignKeyConstraint(['room_id'], ['rooms.id'], ),
      sa.ForeignKeyConstraint(['slot_id'], ['slots.id'], )
      )
      ### end Alembic commands ###
  
  
  def downgrade():
      ### commands auto generated by Alembic - please adjust! ###
      op.drop_table('rooms_slots')
      op.drop_table('presentations')
      op.drop_table('slots')
      op.drop_table('days')
      op.drop_table('rooms')
      ### end Alembic commands ###
  
      context = op.get_context()
      if context.bind.dialect.name == 'postgresql':
          op.execute('DROP TYPE slotkind')
  