"""fix_metric_names Revision ID: 1acc5379edb5 Revises: d55cd0c624a5 Create Date: 2021-03-26 11:47:09.646656 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1acc5379edb5' down_revision = 'd55cd0c624a5' branch_labels = None depends_on = None def upgrade(): bind = op.get_bind() meta = sa.MetaData(bind=bind) meta.reflect() metrics_table = meta.tables["MetricsField"] op.execute( metrics_table.update().values(description='Click-through-rate for unique outbound clicks across all platforms.Value may differ from other ad platforms because Decibel calculates this value by summing unique people each day instead of filtering for unique people across the entire date range.').where(metrics_table.c.id == 42) ) op.execute( metrics_table.update().values(title='Comment').where(metrics_table.c.id == 61) #cost per comments ) op.execute( metrics_table.update().values(title='Lead').where(metrics_table.c.id == 4)# cost per leads ) op.execute( metrics_table.update().values(title='Conversion').where(metrics_table.c.id == 15) # cost per u conversion ) op.execute( metrics_table.update().values(title='Conversions').where(metrics_table.c.id == 71) # unique conversions ) def downgrade(): bind = op.get_bind() meta = sa.MetaData(bind=bind) meta.reflect() metrics_table = meta.tables["MetricsField"] op.execute( metrics_table.update().values(description='Click-through-rate for unique outbound clicks across all platforms.').where(metrics_table.c.id == 42) ) op.execute( metrics_table.update().values(title='Comments').where(metrics_table.c.id == 61) ) op.execute( metrics_table.update().values(title='Leads').where(metrics_table.c.id == 4) ) op.execute( metrics_table.update().values(title='Conversions').where(metrics_table.c.id == 15) ) op.execute( metrics_table.update().values(title='Conversion').where(metrics_table.c.id == 71) )