So, first of all, no pending migrations.
I get:
[...]
File "C:\Program Files\Python37\lib\site-packages\django\db\backends\sqlite3\base.py", line 383, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.IntegrityError: NOT NULL constraint failed: backup_basenode.created
on this line:
node = Node(id=old_node.id, name=clean["name"], customer=customer)
node.save()
The relevant model:
class BaseNode(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
def __str__(self):
return f"{str(self.id)}"
class Node(BaseNode):
customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
name = models.CharField(max_length=200)
def __str__(self):
return f"{self.name}({self.customer})"
From what I gather, the created field should be automatically populated and therefore should not be null?
As to expected behaviour, I'm trying to elevate a BaseNode to a Node, since I haven't found a direct way of doing it, I went with creating a new Node instance and deleting the BaseNode instance.