change from incremental id to uuid-v4
This commit is contained in:
parent
1f360b974e
commit
c6d1206e29
|
@ -3,8 +3,8 @@ import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
|||
|
||||
@Entity()
|
||||
export class EImageBackend extends EImage {
|
||||
@PrimaryGeneratedColumn()
|
||||
override id?: number;
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
override id?: string;
|
||||
|
||||
@Index()
|
||||
@Column({ unique: true, nullable: false })
|
||||
|
|
|
@ -4,8 +4,8 @@ import { Permissions } from '../dto/permissions.dto';
|
|||
|
||||
@Entity()
|
||||
export class ERoleBackend extends ERole {
|
||||
@PrimaryGeneratedColumn()
|
||||
override id?: number;
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
override id?: string;
|
||||
|
||||
@Index()
|
||||
@Column({ nullable: false, unique: true })
|
||||
|
|
|
@ -3,8 +3,8 @@ import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
|||
|
||||
@Entity()
|
||||
export class ESysPreferenceBackend extends ESysPreference {
|
||||
@PrimaryGeneratedColumn()
|
||||
override id?: number;
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
override id?: string;
|
||||
|
||||
@Index()
|
||||
@Column({ nullable: false, unique: true })
|
||||
|
|
|
@ -5,8 +5,8 @@ import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
|||
|
||||
@Entity()
|
||||
export class EUserBackend extends EUser {
|
||||
@PrimaryGeneratedColumn()
|
||||
override id?: number;
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
override id?: string;
|
||||
|
||||
@Index()
|
||||
@Column({ nullable: false, unique: true })
|
||||
|
|
|
@ -2,8 +2,8 @@ import { EUsrPreference } from 'picsur-shared/dist/entities/usrpreference';
|
|||
import { Column, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
export class EUsrPreferenceBackend extends EUsrPreference {
|
||||
@PrimaryGeneratedColumn()
|
||||
override id?: number;
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
override id?: string;
|
||||
|
||||
@Index()
|
||||
@Column({ nullable: false, unique: true })
|
|
@ -33,7 +33,7 @@ export class ValuesPickerComponent implements OnInit, OnChanges {
|
|||
@Input('disabled-list') disabledSelection: string[] = [];
|
||||
|
||||
@Input('value-mapper')
|
||||
valueMapper: (value: string) => string = (value) => 'poopoo';
|
||||
valueMapper: (value: string) => string = (value) => value;
|
||||
|
||||
// Selection
|
||||
private selectableSubject = new BehaviorSubject<string[]>([]);
|
||||
|
|
|
@ -4,7 +4,7 @@ import { EntityID } from '../validators/entity-id.validator';
|
|||
|
||||
export class EImage {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
|
||||
@IsHash('sha256')
|
||||
hash: string;
|
||||
|
|
|
@ -19,5 +19,5 @@ export class RoleNamePermsObject extends RoleNameObject {
|
|||
|
||||
export class ERole extends RoleNamePermsObject {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { EntityID } from '../validators/entity-id.validator';
|
|||
|
||||
export class ESysPreference {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
|
|
|
@ -28,7 +28,7 @@ export class NameRolesUser extends UsernameUser {
|
|||
// Actual entity that goes in the db
|
||||
export class EUser extends NameRolesUser {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Exclude()
|
||||
|
|
|
@ -4,7 +4,7 @@ import { IsPosInt } from '../validators/positive-int.validator';
|
|||
|
||||
export class EUsrPreference {
|
||||
@EntityID()
|
||||
id?: number;
|
||||
id?: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { IsInt, IsNotEmpty, IsOptional, Min } from 'class-validator';
|
||||
import { IsNotEmpty, IsOptional, IsUUID } from 'class-validator';
|
||||
import { CombinePDecorators } from '../util/decorator';
|
||||
|
||||
export const EntityID = CombinePDecorators(IsOptional(), IsInt(), Min(0));
|
||||
export const EntityIDRequired = CombinePDecorators(IsNotEmpty(), IsInt(), Min(0));
|
||||
export const EntityID = CombinePDecorators(IsOptional(), IsUUID('4'));
|
||||
export const EntityIDRequired = CombinePDecorators(IsNotEmpty(), IsUUID('4'));
|
||||
|
|
Loading…
Reference in a new issue