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

migrate database from MySQL to PostgreSQL #46

Merged
merged 4 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading