You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm try to you postman to post data and I'm getting an error " relation "auth_user_entity" does not exist" Does anyone know how to fix this? Thanks very much !
The text was updated successfully, but these errors were encountered:
I am using typeORM and i have an AuthUserEnity `import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from "typeorm";
@entity()
export class AuthUserEntity {
@PrimaryGeneratedColumn()
public id: number;
@column()
public email :string;
@column()
public password :string;
}`
and in AppModule : `import { Module } from "@nestjs/common";
import { ConfigModule, ConfigService } from "@nestjs/config";
import { TypeOrmModule } from "@nestjs/typeorm";
import { AuthUserEntity } from "./auth/auth.user.entity";
import { AuthModule } from "./auth/auth.module";
@module({
imports: [
ConfigModule.forRoot({ isGlobal: true }),
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
type: 'postgres',
host: configService.get('POSTGRES_HOST'),
port: configService.get('POSTGRES_PORT'),
username: configService.get('POSTGRES_USER'),
password: configService.get('POSTGRES_PASSWORD'),
database: configService.get('POSTGRES_DB'),
entities: [AuthUserEntity],
synchronized: true
})
}),
AuthModule
],
controllers: [],
providers: []
})
export class AppModule {
}`
and in AuthModule : `import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";
import { AuthUserEntity } from "./auth.user.entity";
import { JwtStategy } from "./auth.stategy";
import { AuthService } from "./auth.service";
import { AuthController } from "./auth.controller";
import { JwtModule } from "@nestjs/jwt";
@module({
imports: [JwtModule.register({
secret : 'iloveyou',
signOptions : {expiresIn : "1h"}
}),
TypeOrmModule.forFeature([AuthUserEntity])],
providers: [AuthService, JwtStategy],
controllers : [AuthController],
exports: [AuthService]
})
export class AuthModule{
}`
I'm try to you postman to post data and I'm getting an error " relation "auth_user_entity" does not exist" Does anyone know how to fix this? Thanks very much !
The text was updated successfully, but these errors were encountered: