게임서버DB(3)
-
3. Nest.js 광부왕 게임 서버 로그 저장 [로그 데이터]
- Log DB DB : MongoDB 사용 이유 : 대용량의 데이터를 저장 하기 유리한 NoSql 방식의 MongoDB 사용 1. 라이브러리 설치 @nestjs/mongoose mongoose 설치 npm install --save @nestjs/mongoose mongoose 2. model 파일 생성 model 폴더 안에 model 파일 생성 logs.model.ts * 로그 저장 설정 : 로그 저장 기간은 3개월이 되면 자동으로 제거되도록 설정 한다. import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; const options = { timestamps: true, co..
2023.02.19 -
2. Nest.js 광부왕 게임 서버 Mysql TypeOrm 설정 [게임 데이터]
1. Configuration 설정 https://crispypotato.tistory.com/194 Nest .env 파일 사용 방법 1. 설치 npm i --save @nestjs/config https://crispypotato.tistory.com/192 Nest 설치 방법 [ CLI ] 전역 설치 npm i -g @nestjs/cli 프로젝트 생성 nest new 생성 할 프로젝트 이름 생성 중에 패키지 관리툴을 선택하면 설치 crispypotato.tistory.com 2. 라이브러리 설치 typeorm, @nestjs/typeorm, mysql2 설치 npm install --save typeorm mysql2 @nestjs/typeorm 3. model 파일 생성 src폴더 안에 model..
2023.02.16 -
1. Nest.js 광부왕 게임 서버 DB 구성
- Main DB DB : Mysql 사용 범위 유저 Table 아이탬 Table 게임 내역 Table 회사 (길드) Table 회사 (길드) 회원 Table 선물 리스트 보관 Table 스테이지별 난이도 정보 Table 관계 설정 * 스테이별 난이도 정보 Table은 관계가 필요 없어서 설정이 되어 있지 않다. 1. 유저 테이블 관계 1 : N 관계 유저 정보 : 유저 아이탬 유저 정보 : 게임 내역 유저 정보 : 회사 회원 유저 정보 : 선물 리스트 관계 2. 회사 테이블 관계 1:N 관계 회사 : 회사원 유저 Table users.model.ts import { ApiProperty } from '@nestjs/swagger'; import { IsBoolean, IsNotEmpty, IsStrin..
2023.02.16