diff --git a/apps/realworld-api/src/api/article/article.module.ts b/apps/realworld-api/src/api/article/article.module.ts index b40e611..089055c 100644 --- a/apps/realworld-api/src/api/article/article.module.ts +++ b/apps/realworld-api/src/api/article/article.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { ArticleEntity, TagEntity, UserEntity } from '@repo/database-typeorm'; +import { ArticleEntity, TagEntity, UserEntity } from '@repo/mysql-typeorm'; import { ArticleController } from './article.controller'; import { ArticleService } from './article.service'; import { CommentModule } from './comment/comment.module'; diff --git a/apps/realworld-api/src/api/article/article.service.spec.ts b/apps/realworld-api/src/api/article/article.service.spec.ts index 1d4d0df..2c9f247 100644 --- a/apps/realworld-api/src/api/article/article.service.spec.ts +++ b/apps/realworld-api/src/api/article/article.service.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { ArticleEntity, TagEntity, UserEntity } from '@repo/database-typeorm'; +import { ArticleEntity, TagEntity, UserEntity } from '@repo/mysql-typeorm'; import { I18nService } from 'nestjs-i18n'; import { Repository } from 'typeorm'; import { ArticleService } from './article.service'; diff --git a/apps/realworld-api/src/api/article/article.service.ts b/apps/realworld-api/src/api/article/article.service.ts index d0e7aca..13305dc 100644 --- a/apps/realworld-api/src/api/article/article.service.ts +++ b/apps/realworld-api/src/api/article/article.service.ts @@ -2,7 +2,7 @@ import { ErrorCode } from '@/constants/error-code.constant'; import { Injectable, Logger, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { paginate } from '@repo/api/utils/offset-pagination'; -import { ArticleEntity, TagEntity, UserEntity } from '@repo/database-typeorm'; +import { ArticleEntity, TagEntity, UserEntity } from '@repo/mysql-typeorm'; import { I18nService } from 'nestjs-i18n'; import slugify from 'slugify'; import { In, Repository } from 'typeorm'; diff --git a/apps/realworld-api/src/api/article/article.util.ts b/apps/realworld-api/src/api/article/article.util.ts index d436860..f872962 100644 --- a/apps/realworld-api/src/api/article/article.util.ts +++ b/apps/realworld-api/src/api/article/article.util.ts @@ -1,4 +1,4 @@ -import { ArticleEntity, UserEntity } from '@repo/database-typeorm'; +import { ArticleEntity, UserEntity } from '@repo/mysql-typeorm'; import { ProfileDto } from '../profile/dto/profile.dto'; import { ArticleDto } from './dto/article.dto'; diff --git a/apps/realworld-api/src/api/article/comment/comment.module.ts b/apps/realworld-api/src/api/article/comment/comment.module.ts index 7eb8807..8039076 100644 --- a/apps/realworld-api/src/api/article/comment/comment.module.ts +++ b/apps/realworld-api/src/api/article/comment/comment.module.ts @@ -1,10 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { - ArticleEntity, - CommentEntity, - UserEntity, -} from '@repo/database-typeorm'; +import { ArticleEntity, CommentEntity, UserEntity } from '@repo/mysql-typeorm'; import { CommentController } from './comment.controller'; import { CommentService } from './comment.service'; diff --git a/apps/realworld-api/src/api/article/comment/comment.service.spec.ts b/apps/realworld-api/src/api/article/comment/comment.service.spec.ts index 42b508e..140ba2c 100644 --- a/apps/realworld-api/src/api/article/comment/comment.service.spec.ts +++ b/apps/realworld-api/src/api/article/comment/comment.service.spec.ts @@ -1,10 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { - ArticleEntity, - CommentEntity, - UserEntity, -} from '@repo/database-typeorm'; +import { ArticleEntity, CommentEntity, UserEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { CommentService } from './comment.service'; diff --git a/apps/realworld-api/src/api/article/comment/comment.service.ts b/apps/realworld-api/src/api/article/comment/comment.service.ts index e4b1295..3f60f56 100644 --- a/apps/realworld-api/src/api/article/comment/comment.service.ts +++ b/apps/realworld-api/src/api/article/comment/comment.service.ts @@ -3,11 +3,7 @@ import { ErrorCode } from '@/constants/error-code.constant'; import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { ValidationException } from '@repo/api'; -import { - ArticleEntity, - CommentEntity, - UserEntity, -} from '@repo/database-typeorm'; +import { ArticleEntity, CommentEntity, UserEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { CommentListResDto } from './dto/comment-list.dto'; import { CommentResDto } from './dto/comment.dto'; diff --git a/apps/realworld-api/src/api/article/favorite/favorite.module.ts b/apps/realworld-api/src/api/article/favorite/favorite.module.ts index 79b1a92..29f08b5 100644 --- a/apps/realworld-api/src/api/article/favorite/favorite.module.ts +++ b/apps/realworld-api/src/api/article/favorite/favorite.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { ArticleEntity, UserEntity } from '@repo/database-typeorm'; +import { ArticleEntity, UserEntity } from '@repo/mysql-typeorm'; import { FavoriteController } from './favorite.controller'; import { FavoriteService } from './favorite.service'; diff --git a/apps/realworld-api/src/api/article/favorite/favorite.service.spec.ts b/apps/realworld-api/src/api/article/favorite/favorite.service.spec.ts index 44c7d07..b01ead3 100644 --- a/apps/realworld-api/src/api/article/favorite/favorite.service.spec.ts +++ b/apps/realworld-api/src/api/article/favorite/favorite.service.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { ArticleEntity, UserEntity } from '@repo/database-typeorm'; +import { ArticleEntity, UserEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { FavoriteService } from './favorite.service'; diff --git a/apps/realworld-api/src/api/article/favorite/favorite.service.ts b/apps/realworld-api/src/api/article/favorite/favorite.service.ts index 890a4df..a3fa783 100644 --- a/apps/realworld-api/src/api/article/favorite/favorite.service.ts +++ b/apps/realworld-api/src/api/article/favorite/favorite.service.ts @@ -2,7 +2,7 @@ import { ErrorCode } from '@/constants/error-code.constant'; import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { ValidationException } from '@repo/api'; -import { ArticleEntity, UserEntity } from '@repo/database-typeorm'; +import { ArticleEntity, UserEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { toArticleDto } from '../article.util'; import { ArticleResDto } from '../dto/article.dto'; diff --git a/apps/realworld-api/src/api/auth/auth.module.ts b/apps/realworld-api/src/api/auth/auth.module.ts index 2bd92c1..750aa81 100644 --- a/apps/realworld-api/src/api/auth/auth.module.ts +++ b/apps/realworld-api/src/api/auth/auth.module.ts @@ -1,7 +1,7 @@ import { Module } from '@nestjs/common'; import { JwtModule } from '@nestjs/jwt'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { UserEntity } from '@repo/database-typeorm'; +import { UserEntity } from '@repo/mysql-typeorm'; import { AuthController } from './auth.controller'; import { AuthService } from './auth.service'; diff --git a/apps/realworld-api/src/api/auth/auth.service.spec.ts b/apps/realworld-api/src/api/auth/auth.service.spec.ts index 4f5f4ea..7a52bbf 100644 --- a/apps/realworld-api/src/api/auth/auth.service.spec.ts +++ b/apps/realworld-api/src/api/auth/auth.service.spec.ts @@ -2,7 +2,7 @@ import { ConfigService } from '@nestjs/config'; import { JwtService } from '@nestjs/jwt'; import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { UserEntity } from '@repo/database-typeorm'; +import { UserEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { AuthService } from './auth.service'; diff --git a/apps/realworld-api/src/api/auth/auth.service.ts b/apps/realworld-api/src/api/auth/auth.service.ts index 9d1c2f3..22798a6 100644 --- a/apps/realworld-api/src/api/auth/auth.service.ts +++ b/apps/realworld-api/src/api/auth/auth.service.ts @@ -3,7 +3,7 @@ import { Injectable, UnauthorizedException } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { JwtService } from '@nestjs/jwt'; import { InjectRepository } from '@nestjs/typeorm'; -import { UserEntity } from '@repo/database-typeorm'; +import { UserEntity } from '@repo/mysql-typeorm'; import { verifyPassword } from '@repo/nest-common'; import { Repository } from 'typeorm'; import { UserResDto } from '../user/dto/user.dto'; diff --git a/apps/realworld-api/src/api/profile/profile.module.ts b/apps/realworld-api/src/api/profile/profile.module.ts index aebfab0..c882718 100644 --- a/apps/realworld-api/src/api/profile/profile.module.ts +++ b/apps/realworld-api/src/api/profile/profile.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { UserEntity, UserFollowsEntity } from '@repo/database-typeorm'; +import { UserEntity, UserFollowsEntity } from '@repo/mysql-typeorm'; import { ProfileController } from './profile.controller'; import { ProfileService } from './profile.service'; diff --git a/apps/realworld-api/src/api/profile/profile.service.spec.ts b/apps/realworld-api/src/api/profile/profile.service.spec.ts index f31e3fa..6c35ca3 100644 --- a/apps/realworld-api/src/api/profile/profile.service.spec.ts +++ b/apps/realworld-api/src/api/profile/profile.service.spec.ts @@ -1,7 +1,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { UserEntity } from '@repo/database-typeorm'; -import { UserFollowsEntity } from '@repo/database-typeorm/entities/user-follows.entity'; +import { UserEntity } from '@repo/mysql-typeorm'; +import { UserFollowsEntity } from '@repo/mysql-typeorm/entities/user-follows.entity'; import { Repository } from 'typeorm'; import { ProfileService } from './profile.service'; diff --git a/apps/realworld-api/src/api/profile/profile.service.ts b/apps/realworld-api/src/api/profile/profile.service.ts index 717de1f..414fe11 100644 --- a/apps/realworld-api/src/api/profile/profile.service.ts +++ b/apps/realworld-api/src/api/profile/profile.service.ts @@ -2,7 +2,7 @@ import { ErrorCode } from '@/constants/error-code.constant'; import { Injectable, Logger } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { ValidationException } from '@repo/api'; -import { UserEntity, UserFollowsEntity } from '@repo/database-typeorm'; +import { UserEntity, UserFollowsEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { ProfileDto, ProfileResDto } from './dto/profile.dto'; diff --git a/apps/realworld-api/src/api/tag/tag.module.ts b/apps/realworld-api/src/api/tag/tag.module.ts index d3e34b5..5680a47 100644 --- a/apps/realworld-api/src/api/tag/tag.module.ts +++ b/apps/realworld-api/src/api/tag/tag.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { TagEntity } from '@repo/database-typeorm'; +import { TagEntity } from '@repo/mysql-typeorm'; import { TagController } from './tag.controller'; import { TagService } from './tag.service'; diff --git a/apps/realworld-api/src/api/tag/tag.service.spec.ts b/apps/realworld-api/src/api/tag/tag.service.spec.ts index 1437989..f6d9430 100644 --- a/apps/realworld-api/src/api/tag/tag.service.spec.ts +++ b/apps/realworld-api/src/api/tag/tag.service.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { TagEntity } from '@repo/database-typeorm'; +import { TagEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { TagService } from './tag.service'; diff --git a/apps/realworld-api/src/api/tag/tag.service.ts b/apps/realworld-api/src/api/tag/tag.service.ts index f2e4a15..b08a535 100644 --- a/apps/realworld-api/src/api/tag/tag.service.ts +++ b/apps/realworld-api/src/api/tag/tag.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import { TagEntity } from '@repo/database-typeorm'; +import { TagEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { TagListResDto } from './dto/tag-list.dto'; diff --git a/apps/realworld-api/src/api/user/user.module.ts b/apps/realworld-api/src/api/user/user.module.ts index b84eb49..1307023 100644 --- a/apps/realworld-api/src/api/user/user.module.ts +++ b/apps/realworld-api/src/api/user/user.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { UserEntity } from '@repo/database-typeorm'; +import { UserEntity } from '@repo/mysql-typeorm'; import { AuthModule } from '../auth/auth.module'; import { UserController } from './user.controller'; import { UserService } from './user.service'; diff --git a/apps/realworld-api/src/api/user/user.service.spec.ts b/apps/realworld-api/src/api/user/user.service.spec.ts index 18c7d09..b886f68 100644 --- a/apps/realworld-api/src/api/user/user.service.spec.ts +++ b/apps/realworld-api/src/api/user/user.service.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { UserEntity } from '@repo/database-typeorm'; +import { UserEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { AuthService } from '../auth/auth.service'; import { UserService } from './user.service'; diff --git a/apps/realworld-api/src/api/user/user.service.ts b/apps/realworld-api/src/api/user/user.service.ts index 1dcce2a..721709a 100644 --- a/apps/realworld-api/src/api/user/user.service.ts +++ b/apps/realworld-api/src/api/user/user.service.ts @@ -2,7 +2,7 @@ import { ErrorCode } from '@/constants/error-code.constant'; import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { ValidationException } from '@repo/api'; -import { UserEntity } from '@repo/database-typeorm'; +import { UserEntity } from '@repo/mysql-typeorm'; import { Repository } from 'typeorm'; import { AuthService } from '../auth/auth.service'; import { CreateUserReqDto } from './dto/create-user.dto'; diff --git a/apps/realworld-api/src/app.module.ts b/apps/realworld-api/src/app.module.ts index f91a80f..8552f01 100644 --- a/apps/realworld-api/src/app.module.ts +++ b/apps/realworld-api/src/app.module.ts @@ -2,7 +2,7 @@ import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; import { ConfigModule, ConfigService } from '@nestjs/config'; import { TypeOrmModule } from '@nestjs/typeorm'; import { appConfig, Environment } from '@repo/api'; -import { databaseConfig } from '@repo/database-typeorm'; +import { databaseConfig } from '@repo/mysql-typeorm'; import { AsyncContextProvider, FastifyPinoLogger, @@ -21,8 +21,7 @@ import authConfig from './api/auth/config/auth.config'; import { AppController } from './app.controller'; import { AppService } from './app.service'; import { AllConfigType } from './config/config.type'; -// import { TypeOrmConfigService } from './database/mysql-typeorm-config.service'; // Uncomment this line if you are using MySQL -import { TypeOrmConfigService } from './database/typeorm-config.service'; +import { TypeOrmConfigService } from './database/mysql-typeorm-config.service'; const configModule = ConfigModule.forRoot({ isGlobal: true, diff --git a/apps/realworld-api/src/config/config.type.ts b/apps/realworld-api/src/config/config.type.ts index ef816b9..59b25ba 100644 --- a/apps/realworld-api/src/config/config.type.ts +++ b/apps/realworld-api/src/config/config.type.ts @@ -1,6 +1,6 @@ import { AuthConfig } from '@/api/auth/config/auth-config.type'; import { AppConfig } from '@repo/api'; -import { DatabaseConfig } from '@repo/database-typeorm'; +import { DatabaseConfig } from '@repo/mysql-typeorm'; export type AllConfigType = { app: AppConfig; diff --git a/apps/realworld-api/src/database/typeorm-config.service.ts b/apps/realworld-api/src/database/typeorm-config.service.ts index e09c576..b0547a4 100644 --- a/apps/realworld-api/src/database/typeorm-config.service.ts +++ b/apps/realworld-api/src/database/typeorm-config.service.ts @@ -2,7 +2,7 @@ import { AllConfigType } from '@/config/config.type'; import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { TypeOrmModuleOptions, TypeOrmOptionsFactory } from '@nestjs/typeorm'; -import { TypeOrmCustomLogger } from '@repo/database-typeorm'; +import { TypeOrmCustomLogger } from '@repo/mysql-typeorm'; import { join } from 'path'; @Injectable() diff --git a/apps/realworld-api/tsconfig.json b/apps/realworld-api/tsconfig.json index e48ddc5..2bbeb55 100644 --- a/apps/realworld-api/tsconfig.json +++ b/apps/realworld-api/tsconfig.json @@ -16,7 +16,6 @@ "@/guards/*": ["src/guards/*"], "@/interceptors/*": ["src/interceptors/*"], "@/utils/*": ["src/utils/*"] - // "@repo/database-typeorm": ["node_modules/@repo/mysql-typeorm"], // Uncomment this line if you are using MySQL } } }