Jerko Steiner 77838e8e0c packages/comments-server: Migrate to mysql/mariadb
Currently mysql2 prints a warning every time a connection is
established. This should be fixed with soon:

https://github.com/typeorm/typeorm/pull/3753
2019-03-23 21:21:50 +08:00

23 lines
452 B
TypeScript

import {ISession} from '../session/ISession'
import {Column, Entity, PrimaryColumn, Index, ManyToOne} from 'typeorm'
import {User} from './User'
@Entity()
export class Session implements ISession {
@PrimaryColumn()
id!: string
@Index()
@Column({type: 'bigint'})
expiredAt: number = Date.now()
@ManyToOne(type => User, user => user.sessions)
user?: User
@Column({ nullable: true })
userId!: number
@Column('text')
json = ''
}