-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: typeorm migrate 위한 파일 정리 및 config 수정 * refactor: 파일 경로 변경에 의한 import 변경 * migrate: typeorm migrate 성공 * [autofix.ci] apply automated fixes * chore: readme migration 방법 추가 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
feeb8f4
commit f393135
Showing
40 changed files
with
422 additions
and
539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { TypeOrmModuleOptions } from '@nestjs/typeorm'; | ||
import * as dotenv from 'dotenv'; | ||
import { DataSource, DataSourceOptions } from 'typeorm'; | ||
|
||
dotenv.config(); | ||
|
||
export const dbConfig: DataSourceOptions = { | ||
type: 'mysql', | ||
host: process.env.MYSQL_HOST, | ||
port: 3306, | ||
username: process.env.MYSQL_USER, | ||
password: process.env.MYSQL_PASSWORD, | ||
database: process.env.MYSQL_DATABASE, | ||
entities: [__dirname + '/entities/*{.ts,.js}'], | ||
migrations: [__dirname + '/migrate/*{.ts,.js}'], | ||
migrationsTableName: 'typeorm_migrations', | ||
synchronize: false, | ||
}; | ||
|
||
// TypeOrmModuleOptions 는 extends Partial<DataSourceOptions> | ||
export const typeOrmModuleOptions: TypeOrmModuleOptions = dbConfig; | ||
|
||
export const dataSource: DataSource = new DataSource(dbConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { | ||
Column, | ||
Entity, | ||
JoinColumn, | ||
OneToOne, | ||
PrimaryGeneratedColumn, | ||
} from 'typeorm'; | ||
import { Book } from './Book'; | ||
|
||
@Entity('book_info_search_keywords') | ||
export class BookInfoSearchKeywords { | ||
@PrimaryGeneratedColumn({ | ||
type: 'int', | ||
name: 'id', | ||
}) | ||
id: number; | ||
|
||
@Column('varchar', { | ||
name: 'disassembled_title', | ||
length: 255, | ||
nullable: true, | ||
}) | ||
disassembledTitle?: string; | ||
|
||
@Column('varchar', { | ||
name: 'disassembled_author', | ||
length: 255, | ||
nullable: true, | ||
}) | ||
disassembledAuthor?: string; | ||
|
||
@Column('varchar', { | ||
name: 'disassembled_publisher', | ||
length: 255, | ||
nullable: true, | ||
}) | ||
disassembledPublisher?: string; | ||
|
||
@Column('varchar', { name: 'title_initials', length: 255, nullable: true }) | ||
titleInitials?: string; | ||
|
||
@Column('varchar', { name: 'author_initials', length: 255, nullable: true }) | ||
authorInitials?: string; | ||
|
||
@Column('varchar', { | ||
name: 'publisher_initials', | ||
length: 255, | ||
nullable: true, | ||
}) | ||
publisherInitials?: string; | ||
|
||
@Column('int', { name: 'book_info_id', nullable: true }) | ||
bookInfoId?: number; | ||
|
||
@OneToOne(() => Book, (bookInfo) => bookInfo.id) | ||
@JoinColumn([ | ||
{ | ||
name: 'book_info_id', | ||
referencedColumnName: 'id', | ||
}, | ||
]) | ||
bookInfo?: Book; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.