Removing Prisma and Grapql-nestjs-prisma resolvers (#2574)

* Some cleaning

* Fix seeds

* Fix all sign in, sign up flow and apiKey optimistic rendering

* Fix
This commit is contained in:
Charles Bochet
2023-11-19 18:25:47 +01:00
committed by GitHub
parent 18dac1a2b6
commit f5e1d7825a
616 changed files with 2220 additions and 23073 deletions

View File

@ -0,0 +1,50 @@
import { Field, ID, ObjectType } from '@nestjs/graphql';
import {
Entity,
Column,
PrimaryGeneratedColumn,
ManyToOne,
JoinColumn,
CreateDateColumn,
UpdateDateColumn,
} from 'typeorm';
import { BeforeCreateOne, IDField } from '@ptc-org/nestjs-query-graphql';
import { User } from 'src/core/user/user.entity';
import { BeforeCreateOneRefreshToken } from './hooks/before-create-one-refresh-token.hook';
@Entity({ name: 'refreshToken', schema: 'core' })
@ObjectType('RefreshToken')
@BeforeCreateOne(BeforeCreateOneRefreshToken)
export class RefreshToken {
@IDField(() => ID)
@PrimaryGeneratedColumn('uuid')
id: string;
@ManyToOne(() => User, (user) => user.refreshTokens)
@JoinColumn({ name: 'userId' })
user: User;
@Column()
userId: string;
@Field()
@Column('timestamp with time zone')
expiresAt: Date;
@Column('timestamp with time zone', { nullable: true })
deletedAt: Date | null;
@Column('timestamp with time zone', { nullable: true })
revokedAt: Date | null;
@Field()
@CreateDateColumn({ type: 'timestamp with time zone' })
createdAt: Date;
@Field()
@UpdateDateColumn({ type: 'timestamp with time zone' })
updatedAt: Date;
}