text: """empty message
  
  Revision ID: 788103385109
  Revises: 
  Create Date: 2020-04-26 14:59:33.238179
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = '788103385109'
  down_revision = None
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table('meteringpoint',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('created', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
      sa.Column('sub', sa.String(), nullable=False),
      sa.Column('gsrn', sa.String(), nullable=False),
      sa.Column('type', sa.Enum('PRODUCTION', 'CONSUMPTION', name='measurementtype'), nullable=False),
      sa.Column('sector', sa.String(), nullable=False),
      sa.Column('technology_code', sa.String(), nullable=True),
      sa.Column('fuel_code', sa.String(), nullable=True),
      sa.Column('street_code', sa.String(), nullable=True),
      sa.Column('street_name', sa.String(), nullable=True),
      sa.Column('building_number', sa.String(), nullable=True),
      sa.Column('city_name', sa.String(), nullable=True),
      sa.Column('postcode', sa.String(), nullable=True),
      sa.Column('municipality_code', sa.String(), nullable=True),
      sa.Column('ledger_extended_key', sa.String(), nullable=True),
      sa.PrimaryKeyConstraint('id'),
      sa.UniqueConstraint('gsrn')
      )
      op.create_index(op.f('ix_meteringpoint_gsrn'), 'meteringpoint', ['gsrn'], unique=False)
      op.create_index(op.f('ix_meteringpoint_id'), 'meteringpoint', ['id'], unique=False)
      op.create_index(op.f('ix_meteringpoint_sector'), 'meteringpoint', ['sector'], unique=False)
      op.create_index(op.f('ix_meteringpoint_sub'), 'meteringpoint', ['sub'], unique=False)
      op.create_index(op.f('ix_meteringpoint_type'), 'meteringpoint', ['type'], unique=False)
      op.create_table('webhook_subscription',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('event', sa.Enum('ON_GGOS_ISSUED', 'ON_METERINGPOINTS_AVAILABLE', name='event'), nullable=False),
      sa.Column('subject', sa.String(), nullable=False),
      sa.Column('url', sa.String(), nullable=False),
      sa.PrimaryKeyConstraint('id')
      )
      op.create_index(op.f('ix_webhook_subscription_event'), 'webhook_subscription', ['event'], unique=False)
      op.create_index(op.f('ix_webhook_subscription_id'), 'webhook_subscription', ['id'], unique=False)
      op.create_index(op.f('ix_webhook_subscription_subject'), 'webhook_subscription', ['subject'], unique=False)
      op.create_table('measurement',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('created', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
      sa.Column('gsrn', sa.String(), nullable=False),
      sa.Column('begin', sa.DateTime(timezone=True), nullable=False),
      sa.Column('end', sa.DateTime(timezone=True), nullable=False),
      sa.Column('amount', sa.Integer(), nullable=False),
      sa.ForeignKeyConstraint(['gsrn'], ['meteringpoint.gsrn'], ),
      sa.PrimaryKeyConstraint('id'),
      sa.UniqueConstraint('gsrn', 'begin')
      )
      op.create_index(op.f('ix_measurement_begin'), 'measurement', ['begin'], unique=False)
      op.create_index(op.f('ix_measurement_gsrn'), 'measurement', ['gsrn'], unique=False)
      op.create_index(op.f('ix_measurement_id'), 'measurement', ['id'], unique=False)
      op.create_table('ggo',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('created', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
      sa.Column('issue_time', sa.DateTime(timezone=True), nullable=False),
      sa.Column('expire_time', sa.DateTime(timezone=True), nullable=False),
      sa.Column('measurement_id', sa.Integer(), nullable=True),
      sa.ForeignKeyConstraint(['measurement_id'], ['measurement.id'], ),
      sa.PrimaryKeyConstraint('id'),
      sa.UniqueConstraint('measurement_id')
      )
      op.create_index(op.f('ix_ggo_id'), 'ggo', ['id'], unique=False)
      op.create_index(op.f('ix_ggo_measurement_id'), 'ggo', ['measurement_id'], unique=False)
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_index(op.f('ix_ggo_measurement_id'), table_name='ggo')
      op.drop_index(op.f('ix_ggo_id'), table_name='ggo')
      op.drop_table('ggo')
      op.drop_index(op.f('ix_measurement_id'), table_name='measurement')
      op.drop_index(op.f('ix_measurement_gsrn'), table_name='measurement')
      op.drop_index(op.f('ix_measurement_begin'), table_name='measurement')
      op.drop_table('measurement')
      op.drop_index(op.f('ix_webhook_subscription_subject'), table_name='webhook_subscription')
      op.drop_index(op.f('ix_webhook_subscription_id'), table_name='webhook_subscription')
      op.drop_index(op.f('ix_webhook_subscription_event'), table_name='webhook_subscription')
      op.drop_table('webhook_subscription')
      op.drop_index(op.f('ix_meteringpoint_type'), table_name='meteringpoint')
      op.drop_index(op.f('ix_meteringpoint_sub'), table_name='meteringpoint')
      op.drop_index(op.f('ix_meteringpoint_sector'), table_name='meteringpoint')
      op.drop_index(op.f('ix_meteringpoint_id'), table_name='meteringpoint')
      op.drop_index(op.f('ix_meteringpoint_gsrn'), table_name='meteringpoint')
      op.drop_table('meteringpoint')
      # ### end Alembic commands ###
  