Skip to content

Commit

Permalink
Rename constraint for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Nov 27, 2024
1 parent 51554b1 commit d569f34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ fn push_relation_tables(ctx: &mut Context<'_>) {
{
let index_id = if ctx.flavour.uses_pk_in_m2m_join_table() {
let constraint_name = format!(
"{}_AB_pk",
table_name.chars().take(max_identifier_length - 6).collect::<String>()
"{}_AB_pkey",
table_name.chars().take(max_identifier_length - 8).collect::<String>()
);

ctx.schema.describer_schema.push_primary_key(table_id, constraint_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ fn migrations_with_many_to_many_related_models_must_not_recreate_indexes(api: Te
if api.is_postgres() {
table.assert_pk(|pk| {
pk.assert_columns(&["A", "B"])
.assert_constraint_name("_ProfileToSkill_AB_pk")
.assert_constraint_name("_ProfileToSkill_AB_pkey")
})
} else {
table.assert_index_on_columns(&["A", "B"], |idx| {
Expand Down

0 comments on commit d569f34

Please sign in to comment.