Add Session entity

This entity implements the Session interface from connect-typeorm, which we will later use to store session data from express-session.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-08-13 20:25:43 +02:00
parent ef92ab73f9
commit 6bee3b16cf
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 77 additions and 2 deletions

View file

@ -0,0 +1,15 @@
import { ISession } from 'connect-typeorm';
import { Column, Entity, Index, PrimaryColumn } from 'typeorm/index';
@Entity()
export class Session implements ISession {
@PrimaryColumn('varchar', { length: 255 })
public id = '';
@Index()
@Column('bigint')
public expiredAt = Date.now();
@Column('text')
public json = '';
}