Skip to content

Commit

Permalink
Merge pull request #46 from zylcom/preview
Browse files Browse the repository at this point in the history
migrate database from MySQL to PostgreSQL
  • Loading branch information
zylcom authored Mar 13, 2024
2 parents fe47d98 + 9936854 commit 2720fc0
Show file tree
Hide file tree
Showing 6 changed files with 332 additions and 288 deletions.
37 changes: 17 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,30 @@ on:
branches: ["main"]

jobs:
start_mysql:
runs-on: ubuntu-latest

steps:
- run: |
sudo systemctl start mysql.service
mysql -e 'CREATE DATABASE food_app;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
automation_testing:
needs: start_mysql
environment: production
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [18.x]

steps:
- name: Start MySQL
run: |
sudo systemctl start mysql.service
mysql -e 'CREATE DATABASE food_app;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
services:
postgres:
image: postgres
env:
POSTGRES_DB: food_app
POSTGRES_PASSWORD: root
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -49,9 +47,8 @@ jobs:

- name: Prisma migration & test
env:
DATABASE_URL: mysql://root:root@localhost:3306/food_app?connection_limit=5&pool_timeout=0
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
STRIPE_ENDPOINT_SECRET: ${{ secrets.STRIPE_ENDPOINT_SECRET }}
DATABASE_URL: postgresql://postgres:root@localhost:5432/food_app?schema=public&connection_limit=5&pool_timeout=0
DIRECT_URL: postgresql://postgres:root@localhost:5432/food_app?schema=public&connection_limit=5&pool_timeout=0
FRONT_END_BASE_URL: ${{ vars.FRONT_END_BASE_URL }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
MIDTRANS_SERVER_KEY: ${{ secrets.MIDTRANS_SERVER_KEY }}
Expand Down
231 changes: 0 additions & 231 deletions prisma/migrations/20240129052813_init/migration.sql

This file was deleted.

Loading

0 comments on commit 2720fc0

Please sign in to comment.