mirror of
https://github.com/django/django.git
synced 2025-10-27 07:36:08 +00:00
Fixed #36064 -- Skipped an UPDATE when adding a model instance with a composite primary key with default values.
This commit is contained in:
committed by
Sarah Boyce
parent
8287fd4915
commit
5851605863
@@ -1,3 +1,5 @@
|
||||
import uuid
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
@@ -46,8 +48,8 @@ class Comment(models.Model):
|
||||
|
||||
class Post(models.Model):
|
||||
pk = models.CompositePrimaryKey("tenant_id", "id")
|
||||
tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE)
|
||||
id = models.UUIDField()
|
||||
tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE, default=1)
|
||||
id = models.UUIDField(default=uuid.uuid4)
|
||||
|
||||
|
||||
class TimeStamped(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user