mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-18 18:25:28 +10:00
add systemid column and constraint to member.ts entity as well as migration
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
import {Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, Unique} from "typeorm"
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
Unique,
|
||||
ManyToOne,
|
||||
JoinColumn
|
||||
} from "typeorm"
|
||||
import {System} from "./System";
|
||||
|
||||
@Entity({name: "Member", synchronize: true})
|
||||
@Unique("UQ_Member_userid_name", ['userid', 'name'])
|
||||
@@ -10,6 +20,10 @@ export class Member {
|
||||
@Column()
|
||||
userid: string
|
||||
|
||||
@ManyToOne(() => System, (system) => system.id, {eager: true, orphanedRowAction: "delete"})
|
||||
@JoinColumn({ name: "systemid" })
|
||||
system: System
|
||||
|
||||
@Column({
|
||||
length: 100
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user