Skip to content

Commit 1cce176

Browse files
committed
fix: added missing migration for error code
1 parent a5eeadf commit 1cce176

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

deployment/migrations/versions/0036_b7c8d9e0f1a2_add_cost_credit_column.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,20 @@
1919
def upgrade() -> None:
2020
# Add cost_credit column to account_costs table
2121
op.add_column('account_costs', sa.Column('cost_credit', sa.DECIMAL(), nullable=False, server_default='0'))
22+
23+
# Add missing CREDIT_INSUFFICIENT error code
24+
op.execute(
25+
"""
26+
INSERT INTO error_codes(code, description) VALUES
27+
(6, 'Insufficient credit')
28+
ON CONFLICT (code) DO NOTHING
29+
"""
30+
)
2231

2332

2433
def downgrade() -> None:
34+
# Remove CREDIT_INSUFFICIENT error code
35+
op.execute("DELETE FROM error_codes WHERE code = 6")
36+
2537
# Remove cost_credit column from account_costs table
2638
op.drop_column('account_costs', 'cost_credit')

0 commit comments

Comments
 (0)