"""add_us_latin_accounts Revision ID: 43825f7bb6cc Revises: 542328df669a Create Date: 2021-05-06 13:57:43.541260 """ from alembic import op from migrations import utils revision = '43825f7bb6cc' down_revision = 'f5b33a0b627d' branch_labels = None depends_on = None marketing_accounts = [ {"label_id": 6, "provider_id": 2, "account_id": 9038993320, "type": 0}, {"label_id": 6, "provider_id": 1, "account_id": 2437040523002171, "type": 1}, ] def upgrade(): bind = op.get_bind() utils.import_marketing_accounts(bind, marketing_accounts) def downgrade(): bind = op.get_bind() ids = [str(item["account_id"]) for item in marketing_accounts] utils.drop_marketing_accounts(bind, ids)