mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-31 15:18:38 -04:00
Move session entity to sessions folder
Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
parent
eeef0ea025
commit
f362d27d3f
23 changed files with 26 additions and 26 deletions
|
@ -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>;
|
||||
}
|
|
@ -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],
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue