old_contents: """empty message
  
  Revision ID: 0031_add_manage_team_permission
  Revises: 0030_add_template_permission
  Create Date: 2016-02-26 10:33:20.536362
  
  """
  
  # revision identifiers, used by Alembic.
  revision = '0031_add_manage_team_permission'
  down_revision = '0030_add_template_permission'
  import uuid
  from datetime import datetime
  from alembic import op
  import sqlalchemy as sa
  from sqlalchemy.dialects import postgresql
  
  def upgrade():
      ### commands auto generated by Alembic - please adjust! ###
      conn = op.get_bind()
      user_services = conn.execute("SELECT * FROM user_to_service").fetchall()
      for entry in user_services:
          id_ = uuid.uuid4()
          created_at = datetime.now().isoformat().replace('T', ' ')
          conn.execute((
              "INSERT INTO permissions (id, user_id, service_id, permission, created_at)"
              " VALUES ('{}', '{}', '{}', 'manage_team', '{}')").format(id_, entry[0], entry[1], created_at))
          conn.execute((
              "INSERT INTO permissions (id, user_id, service_id, permission, created_at)"
              " VALUES ('{}', '{}', '{}', 'view_activity', '{}')").format(id_, entry[0], entry[1], created_at))
      ### end Alembic commands ###
  
  
  def downgrade():
      ### commands auto generated by Alembic - please adjust! ###
      conn = op.get_bind()
      conn.execute("DELETE FROM permissions where permission='manage_team'")
      conn.execute("DELETE FROM permissions where permission='view_activity'")
  
      ### end Alembic commands ###
new_contents: """empty message
  
  Revision ID: 0031_add_manage_team_permission
  Revises: 0030_add_template_permission
  Create Date: 2016-02-26 10:33:20.536362
  
  """
  
  # revision identifiers, used by Alembic.
  revision = '0031_add_manage_team_permission'
  down_revision = '0030_add_template_permission'
  import uuid
  from datetime import datetime
  from alembic import op
  import sqlalchemy as sa
  from sqlalchemy.dialects import postgresql
  
  def upgrade():
      ### commands auto generated by Alembic - please adjust! ###
      conn = op.get_bind()
      user_services = conn.execute("SELECT * FROM user_to_service").fetchall()
      for entry in user_services:
          id_ = uuid.uuid4()
          created_at = datetime.now().isoformat().replace('T', ' ')
          conn.execute((
              "INSERT INTO permissions (id, user_id, service_id, permission, created_at)"
              " VALUES ('{}', '{}', '{}', 'manage_team', '{}')").format(id_, entry[0], entry[1], created_at))
          id_ = uuid.uuid4()
          conn.execute((
              "INSERT INTO permissions (id, user_id, service_id, permission, created_at)"
              " VALUES ('{}', '{}', '{}', 'view_activity', '{}')").format(id_, entry[0], entry[1], created_at))
      ### end Alembic commands ###
  
  
  def downgrade():
      ### commands auto generated by Alembic - please adjust! ###
      conn = op.get_bind()
      conn.execute("DELETE FROM permissions where permission='manage_team'")
      conn.execute("DELETE FROM permissions where permission='view_activity'")
  
      ### end Alembic commands ###
subject: Fix git review.