Skip to content

Allow explicitly named primary keys, foreign keys, and indices #1355

@timc13

Description

@timc13

a constraintName option on @Index, @PrimaryGeneratedColumn, and @JoinColumn would be nice.

example:

@Entity()
class Post {
  @PrimaryGeneratedColumn({ 
    constraintName: 'pk_post_id' 
  })
  id: number

  @ManyToOne(author => Author, author => author.posts)
  @JoinColumn({ 
    constraintName: 'fk_post_author_id'
  })
  author: Author
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions