mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Fix a CASCADE on shops
This commit is contained in:
25
ram/roster/migrations/0035_alter_rollingstock_shop.py
Normal file
25
ram/roster/migrations/0035_alter_rollingstock_shop.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Generated by Django 5.1.4 on 2025-01-27 22:21
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("metadata", "0023_shop"),
|
||||||
|
("roster", "0034_rollingstock_shop"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="rollingstock",
|
||||||
|
name="shop",
|
||||||
|
field=models.ForeignKey(
|
||||||
|
blank=True,
|
||||||
|
null=True,
|
||||||
|
on_delete=django.db.models.deletion.SET_NULL,
|
||||||
|
to="metadata.shop",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
@@ -104,7 +104,7 @@ class RollingStock(BaseModel):
|
|||||||
)
|
)
|
||||||
production_year = models.SmallIntegerField(null=True, blank=True)
|
production_year = models.SmallIntegerField(null=True, blank=True)
|
||||||
shop = models.ForeignKey(
|
shop = models.ForeignKey(
|
||||||
Shop, on_delete=models.CASCADE, null=True, blank=True
|
Shop, on_delete=models.SET_NULL, null=True, blank=True
|
||||||
)
|
)
|
||||||
purchase_date = models.DateField(null=True, blank=True)
|
purchase_date = models.DateField(null=True, blank=True)
|
||||||
price = models.DecimalField(
|
price = models.DecimalField(
|
||||||
|
Reference in New Issue
Block a user