Skip to content

Automigration creation of same table but different schema #1426

Closed

Description

@j0hn-mc-clane

Hello

I found a small bug inside of the DiffableTable logic.
The equals check in DiffableTable should also check the schema for true equality.

Proposal:

def better_eq(self, value) -> bool:
    if not isinstance(value, DiffableTable):
        return False
    return (
        (self.schema == value.schema)
        and (self.class_name == value.class_name)
        and (self.tablename == value.tablename)
    )


DiffableTable.__eq__ = better_eq

Thanks for taking this up.

Cheers

Activity

  1. j0hn-mc-clane commented on Sep 2, 2026

    @j0hn-mc-clane
    Author

    Remark: migration_manager.sort_table_classes should also be changed I assume, I patched it with a simple list of table_classes because I have no FKs between my models

  2. dantownsend commented on Sep 2, 2026

    @dantownsend
    Member

    Ah yes, good catch.

  3. juneja-varun commented on Sep 2, 2026

    @juneja-varun
    Contributor

    I'll take a shot at this.

  4. juneja-varun commented on Sep 3, 2026

    @juneja-varun
    Contributor

    Opened #1427 with a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions