Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#24390 closed Bug (fixed)

Migration constraint names are non-deterministic due to hash randomization

Reported by: Tim Graham Owned by: nobody
Component: Migrations Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Index name generation in migrations uses hash() which returns a non-deterministic result on Python 3 when hash randomization enabled.

I believe constraint names are expected to be generated deterministically.

Change History (6)

comment:1 by Tim Graham, 10 years ago

Summary: Migration constraint names are non-determinstic due to hash randomizationMigration constraint names are non-deterministic due to hash randomization

comment:2 by László Károlyi, 10 years ago

When fixing this, please look in #24410 too.

comment:3 by Tim Graham, 10 years ago

Has patch: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In f37c11eea3cb860112a26f8a65d823842f65b96f:

Fixed #24390 -- Made migration index names deterministic.

comment:5 by Tim Graham <timograham@…>, 10 years ago

In 4e8b167e4d0817b6ae93be8ad97b31bf203698d8:

Fixed MySQL build failure introduced by refs #24390.

Added table_name back to _create_index_sql() to prevent
duplicate index names on MySQL.

comment:6 by Shai Berger <shai@…>, 10 years ago

In 8ca35d7c6a639933927f45b439363a1614da56f1:

Fixed Oracle build failure introduced by refs #24390.

Used shorter column names to make the generated index name
fit within Oracle's limit of 30 characters

Note: See TracTickets for help on using tickets.
Back to Top