My Django code:
class Prod(Model):
class Meta:
db_table = 'prod'
verbose_name = 'Prod'
verbose_name_plural = 'Prod'
id = AutoField(primary_key=True)
name = CharField(max_length=40)
class TestA(Model):
class Meta:
db_table = 'test_a'
verbose_name = 'TestA'
verbose_name_plural = 'TestA'
id = AutoField(primary_key=True)
prod = ForeignKey(Prod, on_delete=CASCADE)
name = CharField(max_length=40)
....
The generated dbml:
Table TestA {
id auto [note: '''*id*''', pk, unique, not null]
name char [note: '''*name*''', not null]
....
}
ref: prod.TestA.prod_id > prod.Prod.id
It will report the error: Column 'prod_id' does not exist in Table 'TestA '
My Django code:
The generated dbml:
It will report the error:
Column 'prod_id' does not exist in Table 'TestA '