Skip to content

Commit b49b88d

Browse files
committed
Migration syntax fix
1 parent 66f93c2 commit b49b88d

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/apps/orders/migrations/0042_adhoc_bank.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
def set_adhoc_bank(apps, schema_editor): # NOQA: ARG001
88
apps.get_model("orders.Order").objects.filter(
99
Q(bank_id__isnull=True) | Q(bank_id=""),
10+
).filter(
1011
price=0,
1112
).exclude(
1213
user_id=F("author_id"),

src/apps/orders/migrations/0043_update_old_banks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
def set_default_bank_for_selfpaid_orders(apps, schema_editor): # NOQA: ARG001
99
apps.get_model("orders.Order").objects.filter(
1010
Q(bank_id__isnull=True) | Q(bank_id=""),
11+
).filter(
1112
price__gt=0,
1213
user_id=F("author_id"),
1314
).update(bank_id="tinkoff_bank")
@@ -16,6 +17,7 @@ def set_default_bank_for_selfpaid_orders(apps, schema_editor): # NOQA: ARG001
1617
def set_b2b_bank_for_b2b_orders(apps, schema_editor): # NOQA: ARG001
1718
apps.get_model("orders.Order").objects.filter(
1819
Q(bank_id__isnull=True) | Q(bank_id=""),
20+
).filter(
1921
price__gt=0,
2022
).exclude(
2123
user_id=F("author_id"),
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Generated by Django 4.2.23 on 2025-08-24 08:06
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('orders', '0043_add_raw_field'),
10+
('orders', '0044_merge_20250715_1519'),
11+
]
12+
13+
operations = [
14+
]

0 commit comments

Comments
 (0)