
import uuid

revision = '0074_update_sms_rate'
down_revision = '0072_add_dvla_orgs'

from alembic import op


def upgrade():
    op.get_bind()
    op.execute("INSERT INTO provider_rates (id, valid_from, rate, provider_id) "
               "VALUES ('{}', '2017-04-01 00:00:00', 1.58, "
               "(SELECT id FROM provider_details WHERE identifier = 'mmg'))".format(uuid.uuid4())
               )


def downgrade():
    op.get_bind()
    op.execute("DELETE FROM provider_rates where valid_from = '2017-04-01 00:00:00' "
               "and provider_id = (SELECT id FROM provider_details WHERE identifier = 'mmg')")

import uuid

revision = '0074_update_sms_rate'
down_revision = '0073_add_international_sms_flag'

from alembic import op


def upgrade():
    op.get_bind()
    op.execute("INSERT INTO provider_rates (id, valid_from, rate, provider_id) "
               "VALUES ('{}', '2017-04-01 00:00:00', 1.58, "
               "(SELECT id FROM provider_details WHERE identifier = 'mmg'))".format(uuid.uuid4())
               )


def downgrade():
    op.get_bind()
    op.execute("DELETE FROM provider_rates where valid_from = '2017-04-01 00:00:00' "
               "and provider_id = (SELECT id FROM provider_details WHERE identifier = 'mmg')")
Fix db migration merge conflicts
Fix db migration merge conflicts

  
  import uuid
  
  revision = '0074_update_sms_rate'
- down_revision = '0072_add_dvla_orgs'
+ down_revision = '0073_add_international_sms_flag'
  
  from alembic import op
  
  
  def upgrade():
      op.get_bind()
      op.execute("INSERT INTO provider_rates (id, valid_from, rate, provider_id) "
                 "VALUES ('{}', '2017-04-01 00:00:00', 1.58, "
                 "(SELECT id FROM provider_details WHERE identifier = 'mmg'))".format(uuid.uuid4())
                 )
  
  
  def downgrade():
      op.get_bind()
      op.execute("DELETE FROM provider_rates where valid_from = '2017-04-01 00:00:00' "
                 "and provider_id = (SELECT id FROM provider_details WHERE identifier = 'mmg')")
Fix db migration merge conflicts
## Code Before:

import uuid

revision = '0074_update_sms_rate'
down_revision = '0072_add_dvla_orgs'

from alembic import op


def upgrade():
    op.get_bind()
    op.execute("INSERT INTO provider_rates (id, valid_from, rate, provider_id) "
               "VALUES ('{}', '2017-04-01 00:00:00', 1.58, "
               "(SELECT id FROM provider_details WHERE identifier = 'mmg'))".format(uuid.uuid4())
               )


def downgrade():
    op.get_bind()
    op.execute("DELETE FROM provider_rates where valid_from = '2017-04-01 00:00:00' "
               "and provider_id = (SELECT id FROM provider_details WHERE identifier = 'mmg')")
## Instruction:
Fix db migration merge conflicts
## Code After:

import uuid

revision = '0074_update_sms_rate'
down_revision = '0073_add_international_sms_flag'

from alembic import op


def upgrade():
    op.get_bind()
    op.execute("INSERT INTO provider_rates (id, valid_from, rate, provider_id) "
               "VALUES ('{}', '2017-04-01 00:00:00', 1.58, "
               "(SELECT id FROM provider_details WHERE identifier = 'mmg'))".format(uuid.uuid4())
               )


def downgrade():
    op.get_bind()
    op.execute("DELETE FROM provider_rates where valid_from = '2017-04-01 00:00:00' "
               "and provider_id = (SELECT id FROM provider_details WHERE identifier = 'mmg')")