migrate schema to postgres only
This commit is contained in:
parent
c849b8eb18
commit
97ffae009b
33 changed files with 363 additions and 1238 deletions
|
@ -2,9 +2,8 @@ import "dotenv/config";
|
|||
import ms from "ms";
|
||||
import ip from "ip";
|
||||
|
||||
export const DB_TYPE = process.env.DB_TYPE ?? "mysql";
|
||||
export const DB_HOST = process.env.DB_HOST ?? "";
|
||||
export const DB_PORT = Number(process.env.DB_PORT ?? 3306);
|
||||
export const DB_PORT = Number(process.env.DB_PORT ?? 5432);
|
||||
export const DB_NAME = process.env.DB_NAME ?? "";
|
||||
export const DB_USERNAME = process.env.DB_USERNAME ?? "";
|
||||
export const DB_PASSWORD = process.env.DB_PASSWORD ?? "";
|
||||
|
@ -39,7 +38,6 @@ export const TRUST_PROXY = ((): Array<string> | string | boolean | number | null
|
|||
})();
|
||||
|
||||
export function configCheck() {
|
||||
if (DB_TYPE != "mysql" && DB_TYPE != "postgres") throw new Error("set valid value to DB_TYPE (mysql|postgres)");
|
||||
if (DB_HOST == "" || typeof DB_HOST != "string") throw new Error("set valid value to DB_HOST");
|
||||
if (DB_NAME == "" || typeof DB_NAME != "string") throw new Error("set valid value to DB_NAME");
|
||||
if (DB_USERNAME == "" || typeof DB_USERNAME != "string") throw new Error("set valid value to DB_USERNAME");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue