mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-05 21:28:25 -04:00
avoid broken migrations that get dropped in later migration
This commit is contained in:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user