unique fields for tables
This commit is contained in:
parent
684c24e4fd
commit
4378c02d17
16 changed files with 144 additions and 19 deletions
|
@ -32,7 +32,11 @@ export class member {
|
|||
@OneToMany(() => communication, (communications) => communications.member)
|
||||
communications: communication[];
|
||||
|
||||
@ManyToOne(() => salutation, (salutation) => salutation.members)
|
||||
@ManyToOne(() => salutation, (salutation) => salutation.members, {
|
||||
nullable: false,
|
||||
onDelete: "RESTRICT",
|
||||
onUpdate: "RESTRICT",
|
||||
})
|
||||
salutation: salutation;
|
||||
|
||||
@OneToMany(() => membership, (membership) => membership.member)
|
||||
|
|
|
@ -9,7 +9,7 @@ export class newsletter {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
title: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, default: "" })
|
||||
|
|
|
@ -5,7 +5,7 @@ export class protocol {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
title: string;
|
||||
|
||||
@Column({ type: "date" })
|
||||
|
|
|
@ -6,8 +6,8 @@ export class refresh {
|
|||
@PrimaryColumn({ type: "varchar", length: 255 })
|
||||
token: string;
|
||||
|
||||
@PrimaryColumn({ type: "int" })
|
||||
userId: number;
|
||||
@PrimaryColumn()
|
||||
userId: string;
|
||||
|
||||
@Column({ type: "datetime" })
|
||||
expiry: Date;
|
||||
|
|
|
@ -6,7 +6,7 @@ export class award {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
award: string;
|
||||
|
||||
@OneToMany(() => memberAwards, (member) => member.award)
|
||||
|
|
|
@ -6,7 +6,7 @@ export class calendarType {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
type: string;
|
||||
|
||||
@Column({ type: "boolean" }) // none specified cal dav request
|
||||
|
|
|
@ -7,7 +7,7 @@ export class communicationType {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
|
|
|
@ -6,7 +6,7 @@ export class executivePosition {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
position: string;
|
||||
|
||||
@OneToMany(() => memberExecutivePositions, (memberExecutivePositions) => memberExecutivePositions.executivePosition)
|
||||
|
|
|
@ -6,7 +6,7 @@ export class membershipStatus {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
status: string;
|
||||
|
||||
@OneToMany(() => membership, (membership) => membership.status)
|
||||
|
|
|
@ -6,7 +6,7 @@ export class qualification {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
qualification: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
|
|
|
@ -5,7 +5,7 @@ export class template {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
template: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
|
|
|
@ -7,7 +7,7 @@ export class role {
|
|||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
role: string;
|
||||
|
||||
@ManyToMany(() => user, (user) => user.roles, {
|
||||
|
|
|
@ -4,13 +4,13 @@ import { userPermission } from "./user_permission";
|
|||
|
||||
@Entity()
|
||||
export class user {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
@PrimaryColumn({ generated: "uuid", type: "varchar" })
|
||||
id: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", unique: true, length: 255 })
|
||||
mail: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
@Column({ type: "varchar", unique: true, length: 255 })
|
||||
username: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
|
|
|
@ -4,8 +4,8 @@ import { PermissionObject, PermissionString } from "../../type/permissionTypes";
|
|||
|
||||
@Entity()
|
||||
export class userPermission {
|
||||
@PrimaryColumn({ type: "int" })
|
||||
userId: number;
|
||||
@PrimaryColumn()
|
||||
userId: string;
|
||||
|
||||
@PrimaryColumn({ type: "varchar", length: 255 })
|
||||
permission: PermissionString;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue