mirror of
https://github.com/sussy-code/backend.git
synced 2026-04-21 08:51:57 +00:00
Public Key should be unique
Co-authored-by: mrjvs <mistrjvs@gmail.com>
This commit is contained in:
parent
1ee5cf9ffc
commit
a369a6bde7
1 changed files with 9 additions and 2 deletions
|
|
@ -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' })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue