diff --git a/migrations/versions/0306_letter_rates_price_rise.py b/migrations/versions/0306_letter_rates_price_rise.py index 9e6044366..ae9b77b10 100644 --- a/migrations/versions/0306_letter_rates_price_rise.py +++ b/migrations/versions/0306_letter_rates_price_rise.py @@ -37,28 +37,28 @@ CHANGEOVER_DATE = datetime(2019, 9, 30, 23, 0) def upgrade(): # all old rates are going in the bin conn = op.get_bind() - conn.execute(text("UPDATE letter_rates SET end_date = :start WHERE end_date IS NULL"), start=CHANGEOVER_DATE) + # conn.execute(text("UPDATE letter_rates SET end_date = :start WHERE end_date IS NULL"), start=CHANGEOVER_DATE) - base_prices = { - 'second': 30, - 'first': 56, - } - op.bulk_insert('letter_rates', [ - { - 'id': uuid.uuid4(), - 'start_date': CHANGEOVER_DATE, - 'end_date': None, - 'sheet_count': sheet_count, - 'rate': (base_prices[post_class] + (5 * sheet_count)) / 100.0, - 'crown': crown, - 'post_class': post_class, - } - for sheet_count, crown, post_class in itertools.product( - range(1, 6), - [True, False], - ['first', 'second'] - ) - ]) + # base_prices = { + # 'second': 30, + # 'first': 56, + # } + # op.bulk_insert('letter_rates', [ + # { + # 'id': uuid.uuid4(), + # 'start_date': CHANGEOVER_DATE, + # 'end_date': None, + # 'sheet_count': sheet_count, + # 'rate': (base_prices[post_class] + (5 * sheet_count)) / 100.0, + # 'crown': crown, + # 'post_class': post_class, + # } + # for sheet_count, crown, post_class in itertools.product( + # range(1, 6), + # [True, False], + # ['first', 'second'] + # ) + # ]) def downgrade(): diff --git a/migrations/versions/0324_int_letter_rates.py b/migrations/versions/0324_int_letter_rates.py index 3ca8018e6..0c27772dd 100644 --- a/migrations/versions/0324_int_letter_rates.py +++ b/migrations/versions/0324_int_letter_rates.py @@ -29,22 +29,23 @@ def upgrade(): 4 sheets - £1.08 5 sheets - £1.16 """ - op.bulk_insert('letter_rates', [ - { - 'id': uuid.uuid4(), - 'start_date': start_date, - 'end_date': None, - 'sheet_count': sheet_count, - 'rate': (base_rate + (8 * sheet_count)) / 100.0, - 'crown': crown, - 'post_class': post_class, - } - for sheet_count, crown, post_class in itertools.product( - range(1, 6), - [True, False], - ['europe', 'rest-of-world'] - ) - ]) + # op.bulk_insert('letter_rates', [ + # { + # 'id': uuid.uuid4(), + # 'start_date': start_date, + # 'end_date': None, + # 'sheet_count': sheet_count, + # 'rate': (base_rate + (8 * sheet_count)) / 100.0, + # 'crown': crown, + # 'post_class': post_class, + # } + # for sheet_count, crown, post_class in itertools.product( + # range(1, 6), + # [True, False], + # ['europe', 'rest-of-world'] + # ) + # ]) + pass def downgrade(): diff --git a/migrations/versions/0341_new_letter_rates.py b/migrations/versions/0341_new_letter_rates.py index a7e5e162c..1d5e12838 100644 --- a/migrations/versions/0341_new_letter_rates.py +++ b/migrations/versions/0341_new_letter_rates.py @@ -34,24 +34,24 @@ def get_new_rate(sheet_count, post_class): def upgrade(): conn = op.get_bind() - conn.execute(text("UPDATE letter_rates SET end_date = :start WHERE end_date IS NULL"), start=CHANGEOVER_DATE) + # conn.execute(text("UPDATE letter_rates SET end_date = :start WHERE end_date IS NULL"), start=CHANGEOVER_DATE) - op.bulk_insert('letter_rates', [ - { - 'id': uuid.uuid4(), - 'start_date': CHANGEOVER_DATE, - 'end_date': None, - 'sheet_count': sheet_count, - 'rate': get_new_rate(sheet_count, post_class), - 'crown': crown, - 'post_class': post_class, - } - for sheet_count, crown, post_class in itertools.product( - range(1, 6), - [True, False], - ['first', 'second', 'europe', 'rest-of-world'] - ) - ]) + # op.bulk_insert('letter_rates', [ + # { + # 'id': uuid.uuid4(), + # 'start_date': CHANGEOVER_DATE, + # 'end_date': None, + # 'sheet_count': sheet_count, + # 'rate': get_new_rate(sheet_count, post_class), + # 'crown': crown, + # 'post_class': post_class, + # } + # for sheet_count, crown, post_class in itertools.product( + # range(1, 6), + # [True, False], + # ['first', 'second', 'europe', 'rest-of-world'] + # ) + # ]) def downgrade(): # Make sure you've thought about billing implications etc before downgrading! diff --git a/migrations/versions/0366_letter_rates_2022.py b/migrations/versions/0366_letter_rates_2022.py index 0403a893c..542ea0de5 100644 --- a/migrations/versions/0366_letter_rates_2022.py +++ b/migrations/versions/0366_letter_rates_2022.py @@ -34,24 +34,24 @@ def get_new_rate(sheet_count, post_class): def upgrade(): conn = op.get_bind() - conn.execute(text("UPDATE letter_rates SET end_date = :start WHERE end_date IS NULL"), start=CHANGEOVER_DATE) + # conn.execute(text("UPDATE letter_rates SET end_date = :start WHERE end_date IS NULL"), start=CHANGEOVER_DATE) - op.bulk_insert('letter_rates', [ - { - 'id': uuid.uuid4(), - 'start_date': CHANGEOVER_DATE, - 'end_date': None, - 'sheet_count': sheet_count, - 'rate': get_new_rate(sheet_count, post_class), - 'crown': crown, - 'post_class': post_class, - } - for sheet_count, crown, post_class in itertools.product( - range(1, 6), - [True, False], - ['first', 'second', 'europe', 'rest-of-world'] - ) - ]) + # op.bulk_insert('letter_rates', [ + # { + # 'id': uuid.uuid4(), + # 'start_date': CHANGEOVER_DATE, + # 'end_date': None, + # 'sheet_count': sheet_count, + # 'rate': get_new_rate(sheet_count, post_class), + # 'crown': crown, + # 'post_class': post_class, + # } + # for sheet_count, crown, post_class in itertools.product( + # range(1, 6), + # [True, False], + # ['first', 'second', 'europe', 'rest-of-world'] + # ) + # ]) def downgrade():