mirror of
https://github.com/usatiuk/writer.git
synced 2025-10-29 00:17:48 +01:00
(hopefully) fix ER_TOO_LONG_KEY error
This commit is contained in:
@@ -23,10 +23,13 @@ export class Document extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
public id: number;
|
||||
|
||||
@ManyToOne(type => User, user => user.documents)
|
||||
@ManyToOne(
|
||||
type => User,
|
||||
user => user.documents,
|
||||
)
|
||||
public user: User;
|
||||
|
||||
@Column()
|
||||
@Column({ length: 190 })
|
||||
public name: string;
|
||||
|
||||
@Column({ type: "text", default: "" })
|
||||
|
||||
@@ -29,18 +29,21 @@ export class User extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
public id: number;
|
||||
|
||||
@Column()
|
||||
@Column({ length: 190})
|
||||
@Index({ unique: true })
|
||||
public username: string;
|
||||
|
||||
@Column()
|
||||
@Column({ length: 190 })
|
||||
@Index({ unique: true })
|
||||
public email: string;
|
||||
|
||||
@Column()
|
||||
@Column({ length: 190 })
|
||||
public passwordHash: string;
|
||||
|
||||
@OneToMany(type => Document, document => document.user)
|
||||
@OneToMany(
|
||||
type => Document,
|
||||
document => document.user,
|
||||
)
|
||||
public documents: Document[];
|
||||
|
||||
constructor(username: string, email: string) {
|
||||
|
||||
Reference in New Issue
Block a user