Intermediate Table for ManyToManyRelation not being created
class Event(models.Model):
id = fields.BigIntField(pk=True)
name = fields.CharField(max_length=100)
participants: fields.ManyToManyRelation["Team"] = fields.ManyToManyField(
"models.Team", related_name="events", through="event_team"
)
class Team(models.Model):
id = fields.BigIntField(pk=True)
name = fields.CharField(max_length=100)
events: fields.ManyToManyRelation[Event]
I have these models Event and Team with a ManyToManyRelation specified via event_team.
When I run aerich migrate, schemas for the table event and team are generated, however, there's no schema being generated for event_team.
The only way I could autogenerate table event_team is by setting generate_schemas=True in register_tortoise()
Is there any other way I could get the schema of the intermediate table for ManyToManyRelation by aerich?
@long2ice is this supported? or is it yet to be implemented?
It should be supported yet, maybe bugs there.
Okay, I'll check it out. Thanks :+1:
Hello. In this case, the error is reproduced precisely with the migrate command, if you delete all migrations and run aerich init-db, intermediate table will be created
@MaboUhha your suggestion might work, but I'll lose all of my existing migration files.
it works if I delete all my migrations and do aerich init-db again, but this isn't really optimal