From 10bc941a2e4808367c377052cfc1f845b6861ca7 Mon Sep 17 00:00:00 2001 From: abdinasir-Tman Date: Sat, 3 Feb 2024 01:43:37 -0800 Subject: [PATCH] modified schema name --- .../MongoDB/TypeORM/NoAuth/src/config/db.config.js | 2 +- .../javascript/MongoDB/TypeORM/NoAuth/src/entity/User.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/yonode-templates/javascript/MongoDB/TypeORM/NoAuth/src/config/db.config.js b/packages/yonode-templates/javascript/MongoDB/TypeORM/NoAuth/src/config/db.config.js index 74cbd3ea..eb5b2ed1 100644 --- a/packages/yonode-templates/javascript/MongoDB/TypeORM/NoAuth/src/config/db.config.js +++ b/packages/yonode-templates/javascript/MongoDB/TypeORM/NoAuth/src/config/db.config.js @@ -8,7 +8,7 @@ const AppDataSource = new DataSource({ type: "mongodb", url: dbURL, database: "yonode", - // entities: [User], + entities: ["../entity/**/*.js"], synchronize: true, }); AppDataSource.initialize() diff --git a/packages/yonode-templates/javascript/MongoDB/TypeORM/NoAuth/src/entity/User.js b/packages/yonode-templates/javascript/MongoDB/TypeORM/NoAuth/src/entity/User.js index 8ac15510..aad4b95b 100644 --- a/packages/yonode-templates/javascript/MongoDB/TypeORM/NoAuth/src/entity/User.js +++ b/packages/yonode-templates/javascript/MongoDB/TypeORM/NoAuth/src/entity/User.js @@ -1,8 +1,8 @@ import { EntitySchema } from "typeorm"; -const User = new EntitySchema({ - name: "Category", // Will use table name `category` as default behaviour. - tableName: "categories", // Optional: Provide `tableName` property to override the default behaviour for table name. +const schemaName = new EntitySchema({ + name: "schemaName", // Will use table name `category` as default behaviour. + tableName: "tableName", // Optional: Provide `tableName` property to override the default behaviour for table name. columns: { id: { primary: true, @@ -14,4 +14,4 @@ const User = new EntitySchema({ }, }, }); -export default User; +export default schemaName;