nextjs prisma 2

[Next.js] Planet Scale + Prisma ๋ฐฐํฌํ•˜๊ธฐ2 (Vercel)

์ด์ „ ํฌ์Šคํ„ฐ์—์„œ๋Š” Next.js์—์„œ Planet Scale + Prisma ๋ฐฐํฌํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„ ๋ณด์•˜์Šต๋‹ˆ๋‹ค. main ๋ธŒ๋žœ์น˜๋ฅผ ๋ฐฐํฌ์šฉ ๋ธŒ๋žœ์น˜๋กœ ์„ค์ •ํ•œ ์ดํ›„์— ์Šคํ‚ค๋งˆ๋ฅผ ์ƒˆ๋กœ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ์ˆ˜์ •ํ•  ๊ฒฝ์šฐ์—๋Š”, ์ˆ˜์ • ๋‚ด์šฉ์„ ์–ด๋–ป๊ฒŒ main ๋ธŒ๋žœ์น˜์— ๋ฐ˜์˜ํ•  ์ˆ˜ ์žˆ์„๊นŒ์š”? ๊ทธ ํ•ด๋‹ต์„ ์ง€๊ธˆ๋ถ€ํ„ฐ ์•Œ์•„๊ฐ€ ๋ด…์‹œ๋‹ค. ๐Ÿคธ๐Ÿป‍โ™€๏ธ 1. ์Šคํ‚ค๋งˆ ์ˆ˜์ • ๋จผ์ € ์Šคํ‚ค๋งˆ๋ฅผ ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”. 2. ์ˆ˜์ •ํ•œ ๋‚ด์šฉ develop branch์— ๋ฐ˜์˜ npx prisma db push ์ˆ˜์ •๋œ ๋‚ด์šฉ์„ develop branch (๊ฐœ๋ฐœ์šฉ ๋ธŒ๋žœ์น˜)์— ๋ฐ˜์˜ํ•˜๊ธฐ ์œ„ํ•ด ์œ„ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ด ์ค๋‹ˆ๋‹ค. 3. develop branch์˜ ๋‚ด์šฉ์„ main branch์— ๋ฐ˜์˜ ํ˜„์žฌ๋Š” ์ˆ˜์ •๋œ ๋‚ด์šฉ์ด develop branch์—๋งŒ ๋ฐ˜์˜๋๊ธฐ ๋•Œ๋ฌธ์— ๋ฐฐํฌ ํ™˜๊ฒฝ์—์„œ๋Š” ์ด ๋ณ€๊ฒฝ ์‚ฌ..

Next.js 2023.04.04

[Next.js] Planet Scale + Prisma ๋ฐฐํฌํ•˜๊ธฐ (Vercel)

๐Ÿš€ ํ”„๋กœ์ ํŠธ ๋ฐฐํฌํ•˜๊ธฐ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์—์„œ ์‚ฌ์šฉํ•˜๋˜ DB์™€ ๋ฐฐํฌ ํ™˜๊ฒฝ์—์„œ ์‚ฌ์šฉํ•  DB๋ฅผ ํ˜ผ์šฉํ•˜์ง€ ์•Š๊ธฐ ์œ„ํ•ด์„œ๋Š” ํ”„๋กœ์ ํŠธ ๊ฐœ๋ฐœ ์‹œ์— ๋งŒ๋“  DB branch๋ฅผ ๋ฐฐํฌํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ์ง€๊ธˆ๋ถ€ํ„ฐ branch ๋ฐฐํฌ ๋ฐฉ๋ฒ•์„ ํ•œ ๋‹จ๊ณ„์”ฉ ์•Œ์•„๊ฐ€ ๋ด…์‹œ๋‹ค. (๊ธ€์“ด์ด๋Š” Vercel๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ๋ฐฐํฌํ–ˆ์Šต๋‹ˆ๋‹ค.) 1. Promote branch https://app.planetscale.com/ Sign in - PlanetScale auth.planetscale.com ์šฐ์„  PlanetScale ์‚ฌ์ดํŠธ์— ์ ‘์†ํ•ด ๋กœ๊ทธ์ธ ํ›„, main branch์— ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค. Promote a branch to production ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด main branch๊ฐ€ production์œผ๋กœ ์„ค์ •๋ฉ๋‹ˆ๋‹ค. 2. Add Environment Varia..

Next.js 2022.10.18
๋ฐ˜์‘ํ˜•