Skip to content

Commit

Permalink
Database Shifted to Oracle Server
Browse files Browse the repository at this point in the history
  • Loading branch information
piercing-wind committed Aug 15, 2024
1 parent 17f5bf2 commit dff8f59
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 42 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
- run: npm install -g pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- name: Prisma Migration Deploy
run: npx run prisma generate
- run: npx run prisma migrate deploy

- name: Change directory
run: cd /home/ubuntu/actions-runner/_work/ai_flavoured/ai_flavoured
- name: Install PM2
Expand Down
4 changes: 2 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ generator client {
provider = "prisma-client-js"
}

datasource db {
datasource db {
provider = "postgresql"
url = env("AZURE_PG_CONNECTION_STRING")
url = env("POSTGRESS_CONNECTION_STRING")
}

model User {
Expand Down
45 changes: 5 additions & 40 deletions src/db/db.ts
Original file line number Diff line number Diff line change
@@ -1,51 +1,16 @@
import pg from "pg";

// export const pool = new pg.Pool({
// host: process.env.HOST,
// user: process.env.USER_NAME,
// password: process.env.PASSWORD,
// port: 5432 || process.env.PORT,
// database: process.env.DATABASE_NAME,
// idleTimeoutMillis: 30000,
// });
// export const pool = new pg.Pool({
// host: process.env.SUPABASE_HOST,
// user: process.env.SUPABASE_USER,
// password: process.env.SUPABASE_PASSWORD,
// port: 6543 || process.env.SUPABASE_PORT,
// database: process.env.SUPABASE_DB_NAME,
// idleTimeoutMillis: 30000,
// });
// export const pool = new pg.Pool({
// host: process.env.NEON_HOST,
// user: process.env.NEON_USER,
// password: process.env.NEON_PASSWORD,
// port: 5432 || process.env.NEON_PORT,
// database: process.env.NEON_DB_NAME,
// idleTimeoutMillis: 30000,
// ssl: {
// rejectUnauthorized: false
// }
// });
export const pool = new pg.Pool({
host: process.env.AZURE_PGHOST,
user: process.env.AZURE_PGUSER,
password: process.env.AZURE_PGPASSWORD,
port: 5432 || process.env.AZURE_PGPORT,
database: process.env.AZURE_PGDATABASE,
host: process.env.PG_HOST,
user: process.env.PG_USER,
password: process.env.PG_PASSWORD,
port: 5432 || process.env.PG_PORT,
database: process.env.PG_DATABASE,
idleTimeoutMillis: 30000,
ssl: {
rejectUnauthorized: false
}
});
// export const pool = new pg.Pool({
// host: process.env.RDS_DATABASE_HOST_AWS,
// database: process.env.PG_DATABASE_NAME_AWS,
// user: process.env.PG_USER_AWS,
// password: process.env.PG_PASSWORD_AWS,
// port: 5432 || process.env.PG_PORT_AWS,
// idleTimeoutMillis: 30000,
// });

/**
* **DataBase Query**
Expand Down

0 comments on commit dff8f59

Please sign in to comment.