Skip to content

Wrong order for table drop #50

@antoyo

Description

@antoyo

Hi.
It seems the order of tables with relations is wrong.

For instance, it's trying to do:

  DROP TABLE "payer"; 
  DROP TABLE "transaction";

for the following models:

class Payer(BaseModel):
    pass


class Transaction(BaseModel):
    payer = ForeignKeyField(Payer, backref="transactions")

(which were deleted from the code)

Actually, it seems random, because a subsequent run was in the right order:

  DROP TABLE "transaction"; 
  DROP TABLE "payer";

So, I guess the tool does not check for relations in the database tables.
Thanks to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions