forked from PluralFlux/PluralFlux
Add unique index migration (#34)
* add migration to delete duplicates that currently exist in the db * change model and migration to add a unique index constraint to id and name * renamed unique index name to be readable * redid model and migration to use @Unique instead of @Index * remove //Here comment --------- Co-authored-by: Aster Fialla <asterfialla@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn} from "typeorm"
|
||||
import {Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, Unique} from "typeorm"
|
||||
|
||||
@Entity({name: "Member", synchronize: true})
|
||||
@Unique("UQ_Member_userid_name", ['userid', 'name'])
|
||||
export class Member {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
|
||||
Reference in New Issue
Block a user