new_contents: """Initial revision
  
  Revision ID: 0fb2e85f3119
  Revises: 
  Create Date: 2017-09-25 16:06:47.777465
  
  """
  
  # revision identifiers, used by Alembic.
  revision = '0fb2e85f3119'
  down_revision = None
  branch_labels = ('confgen',)
  depends_on = '7829ac7b5ad0'
  
  from alembic import op
  import sqlalchemy as sa
  from sqlalchemy import FetchedValue
  from netprofile.db import ddl as npd
  from netprofile.db import fields as npf
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table('srv_types',
      sa.Column('srvtypeid', npf.UInt32(), npd.Comment('Server type ID'), nullable=False, default=sa.Sequence('srv_types_srvtypeid_seq', start=101, increment=1)),
      sa.Column('name', sa.Unicode(length=255), npd.Comment('Server type name'), nullable=False),
      sa.Column('gen', npf.ASCIIString(length=64), npd.Comment('Registered generator class name'), nullable=False),
      sa.Column('paramdef', npf.JSONData(), npd.Comment('Dictionary of parameter defaults'), server_default=sa.text('NULL'), nullable=True),
      sa.Column('descr', sa.UnicodeText(), npd.Comment('Server type description'), server_default=sa.text('NULL'), nullable=True),
      sa.PrimaryKeyConstraint('srvtypeid', name=op.f('srv_types_pk')),
      mysql_charset='utf8',
      mysql_engine='InnoDB'
      )
      op.set_table_comment('srv_types', 'Server types')
      op.create_index('srv_types_u_name', 'srv_types', ['name'], unique=True)
      op.create_table('srv_def',
      sa.Column('srvid', npf.UInt32(), npd.Comment('Server ID'), nullable=False, default=sa.Sequence('srv_def_srvid_seq')),
      sa.Column('hostid', npf.UInt32(), npd.Comment('Host ID'), nullable=False),
      sa.Column('srvtypeid', npf.UInt32(), npd.Comment('Server type ID'), nullable=False),
      sa.ForeignKeyConstraint(['hostid'], ['hosts_def.hostid'], name='srv_def_fk_hostid', onupdate='CASCADE'),
      sa.ForeignKeyConstraint(['srvtypeid'], ['srv_types.srvtypeid'], name='srv_def_fk_srvtypeid', onupdate='CASCADE'),
      sa.PrimaryKeyConstraint('srvid', name=op.f('srv_def_pk')),
      mysql_charset='utf8',
      mysql_engine='InnoDB'
      )
      op.set_table_comment('srv_def', 'Servers')
      op.create_index('srv_def_i_srvtypeid', 'srv_def', ['srvtypeid'], unique=False)
      op.create_index('srv_def_u_srv', 'srv_def', ['hostid', 'srvtypeid'], unique=True)
      op.create_table('srv_params',
      sa.Column('srvparamid', npf.UInt32(), npd.Comment('Server parameter ID'), nullable=False, default=sa.Sequence('srv_params_srvparamid_seq')),
      sa.Column('srvid', npf.UInt32(), npd.Comment('Server ID'), nullable=False),
      sa.Column('name', npf.ASCIIString(length=64), npd.Comment('Server parameter name'), nullable=False),
      sa.Column('value', sa.Unicode(length=255), npd.Comment('Server parameter value'), server_default=sa.text('NULL'), nullable=True),
      sa.ForeignKeyConstraint(['srvid'], ['srv_def.srvid'], name='srv_params_fk_srvid', onupdate='CASCADE', ondelete='CASCADE'),
      sa.PrimaryKeyConstraint('srvparamid', name=op.f('srv_params_pk')),
      mysql_charset='utf8',
      mysql_engine='InnoDB'
      )
      op.set_table_comment('srv_params', 'Server parameters')
      op.create_index('srv_params_i_name', 'srv_params', ['name'], unique=False)
      op.create_index('srv_params_u_param', 'srv_params', ['srvid', 'name'], unique=True)
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_index('srv_params_u_param', table_name='srv_params')
      op.drop_index('srv_params_i_name', table_name='srv_params')
      op.drop_table('srv_params')
      op.drop_index('srv_def_u_srv', table_name='srv_def')
      op.drop_index('srv_def_i_srvtypeid', table_name='srv_def')
      op.drop_table('srv_def')
      op.drop_index('srv_types_u_name', table_name='srv_types')
      op.drop_table('srv_types')
      # ### end Alembic commands ###
  
  
subject: Add initial migration for confgen module