Public Key should be unique

Co-authored-by: mrjvs <mistrjvs@gmail.com>
This commit is contained in:
William Oldham
2023-11-04 12:51:22 +00:00
parent 1ee5cf9ffc
commit a369a6bde7

View File

@@ -1,4 +1,11 @@
import { Entity, Index, PrimaryKey, Property, types } from '@mikro-orm/core'; import {
Entity,
Index,
PrimaryKey,
Property,
Unique,
types,
} from '@mikro-orm/core';
import { nanoid } from 'nanoid'; import { nanoid } from 'nanoid';
export type UserProfile = { export type UserProfile = {
@@ -13,7 +20,7 @@ export class User {
id: string = nanoid(12); id: string = nanoid(12);
@Property({ name: 'public_key', type: 'text' }) @Property({ name: 'public_key', type: 'text' })
@Index() @Unique()
publicKey!: string; publicKey!: string;
@Property({ name: 'namespace' }) @Property({ name: 'namespace' })