Move session entity to sessions folder

Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
Yannick Bungers 2023-06-25 21:52:44 +02:00 committed by Tilman Vatteroth
parent eeef0ea025
commit f362d27d3f
23 changed files with 26 additions and 26 deletions

View file

@ -1,35 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { ISession } from 'connect-typeorm';
import {
Column,
DeleteDateColumn,
Entity,
Index,
ManyToOne,
PrimaryColumn,
} from 'typeorm';
import { Author } from '../authors/author.entity';
@Entity()
export class Session implements ISession {
@PrimaryColumn('varchar', { length: 255 })
public id = '';
@Index()
@Column('bigint')
public expiredAt = Date.now();
@Column('text')
public json = '';
@DeleteDateColumn()
public destroyedAt?: Date;
@ManyToOne(() => Author, (author) => author.sessions)
author: Promise<Author>;
}

View file

@ -8,12 +8,12 @@ import { TypeOrmModule } from '@nestjs/typeorm';
import { Identity } from '../identity/identity.entity';
import { LoggerModule } from '../logger/logger.module';
import { Session } from './session.entity';
import { Session } from '../sessions/session.entity';
import { User } from './user.entity';
import { UsersService } from './users.service';
@Module({
imports: [TypeOrmModule.forFeature([User, Identity, Session]), LoggerModule],
imports: [TypeOrmModule.forFeature([User, Identity]), LoggerModule, Session],
providers: [UsersService],
exports: [UsersService],
})