Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ’š [Chore] Dockerize postgreSQL #35

Merged
merged 3 commits into from
Apr 8, 2023

Conversation

jis-kim
Copy link
Contributor

@jis-kim jis-kim commented Apr 7, 2023

Summary

  • postgreSQL 초기 μ„€μ • 및 도컀 μ„€μ •.
  • typeORM κ³Ό μ—°λ™ν•˜κΈ° μœ„ν•œ entity 파일 생성.

Describe your changes

  • TypeORM κ³Ό db μ—°κ²°ν•΄μ„œ μ‚¬μš©ν•˜κΈ° μœ„ν•œ entity file μ •μ˜.
    • λͺ¨λ“  foreign constraint 적용, cascade λŠ” μ μš©μ•ˆν•¨.
  • postgres container μ˜¬λ¦¬λŠ” docker-compose.yml μž‘μ„±
  • yarn μ»€λ§¨λ“œλ‘œ docker compose up κ°€λŠ₯ν•˜λ„λ‘ package.json 파일 μˆ˜μ •
    • yarn db, yarn db:down, yarn db:reset
  • 초기 DB ν…Œμ΄λΈ” μƒμ„±ν•˜λŠ” create-table.sql 파일 μΆ”κ°€

πŸ”΄ 필독! app 초기 μ‹€ν–‰μˆœμ„œ

backend 디렉토리 μ•ˆμ—μ„œ μ‹€ν–‰ν•΄μ£Όμ„Έμš”.

  • yarn db
  • psql -U username -d dbname -f ../database/create-table.sql
    • psql 은 μ„€μΉ˜κ°€ ν•„μš”ν•  수 μžˆμŠ΅λ‹ˆλ‹€. brew install psql
  • yarn run start

Issue number and link

jis-kim added 3 commits April 7, 2023 22:03
- TypeORM κ³Ό db μ—°κ²°ν•΄μ„œ μ‚¬μš©ν•˜κΈ° μœ„ν•œ entity file μ •μ˜.
- λͺ¨λ“  foreign constraint 적용, cascade μ μš©μ•ˆν•¨. 의견 λ‚˜λˆ λ³΄κ³  μˆ˜μ •.
- postgres container μ˜¬λ¦¬λŠ” docker-compose.yml μž‘μ„±
- yarn μ»€λ§¨λ“œλ‘œ compose up κ°€λŠ₯ν•˜λ„λ‘ package.json 파일 μˆ˜μ •
- yarn db, yarn db:down, yarn db:reset
- entity 둜 λ§Œλ“  ν…Œμ΄λΈ”λ“€μ„ pg_dump 둜 export ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
- yarn db ν›„ `psql -U username -d dbname -f create-table.sql` ν›„! start ν•΄μ£Όμ„Έμš”.
@jis-kim jis-kim added enhancement New feature or request backend issue for backend labels Apr 7, 2023
@jis-kim jis-kim requested review from Kimhan-nah and anso33 April 7, 2023 13:32
@jis-kim jis-kim self-assigned this Apr 7, 2023
@nyeoni
Copy link
Member

nyeoni commented Apr 7, 2023

μš°μ™•!! app 초기 μ‹€ν–‰μˆœμ„œ issue / docs 둜 λ”°λ‘œ μ μ–΄μ„œ pin ν•΄μ£Όμ‹€ 수 μžˆλ‚˜μš©? >_<

@jis-kim
Copy link
Contributor Author

jis-kim commented Apr 7, 2023

μš°μ™•!! app 초기 μ‹€ν–‰μˆœμ„œ issue / docs 둜 λ”°λ‘œ μ μ–΄μ„œ pin ν•΄μ£Όμ‹€ 수 μžˆλ‚˜μš©? >_<

λ‚΄μš© λ³΄μΆ©ν•΄μ„œ pin μ™„λ£Œν–ˆμŠ΅λ‹ˆλ‹€!!

@jis-kim jis-kim linked an issue Apr 7, 2023 that may be closed by this pull request
Copy link
Member

@anso33 anso33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

κ³ μƒν•˜μ…¨μŠ΅λ‹ˆλ‹€ λ°±μ—”λ“œ μž₯λ‹˜........

Copy link
Member

@Kimhan-nah Kimhan-nah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entity.. κ³ μƒν•˜μ…¨μŠ΅λ‹ˆλ‹€μ•„

@jis-kim jis-kim merged commit 006dafd into main Apr 8, 2023
@jis-kim jis-kim deleted the feature/back/database-dockerize branch April 8, 2023 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend issue for backend enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

πŸ’š [Chore] Postgresql docker ν™˜κ²½μ„€μ •
4 participants