Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration will keep create and drop indexes if index name is the same across tables #3379

Closed
hkjeffchan opened this issue Jan 7, 2019 · 0 comments

Comments

@hkjeffchan
Copy link
Contributor

Issue type:

[x] bug report

Database system/driver:

[x] mysql / mariadb

TypeORM version:

[x] latest

Steps to reproduce or a small repository showing the problem:
album.ts

@Entity('album')
@Index('album_id', ['id'])
export class Album {
    @Column('int', {
        nullable: false,
        primary: true,
        name: 'album_id',
    })
    id: number;
}

albumData.ts

@Entity('albumData')
@Index('album_id', ['id'])
export class AlbumData {
    @Column('int', {
        nullable: false,
        primary: true,
        name: 'album_id',
    })
    id: number;
}

This migration or schema sync will keep dropping and creating the index every time because the index columnNames are ['album_id', 'album_id'] and it should be ['album_id'] only.

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

No branches or pull requests

3 participants