Skip to content
Snippets Groups Projects
Commit 5c9f3340 authored by alrwasheda's avatar alrwasheda :speech_balloon:
Browse files

name "checkDB" changed to "createTableIfNotExists"

parent ac2700a5
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ import Customer from "./models/Customer";
import Boat from "./models/Boat";
import Worker from "./models/Worker";
import CheckIn from "./models/CheckIn";
import { checkDB } from "./seqConnection";
import { createTableIfNotExists } from "./seqConnection";
const isDev = process.env.NODE_ENV === "development";
......@@ -13,7 +13,7 @@ const dbInit = async () => {
await CheckIn.sync({ alter: isDev });
};
const connectAndInit = async () => {
await checkDB();
await createTableIfNotExists();
await dbInit();
};
export default connectAndInit;
......@@ -14,7 +14,7 @@ let sequelizeConnection = new Sequelize(
}
);
//check if DB in env exists. If not, create a one
export const checkDB = async () => {
export const createTableIfNotExists = async () => {
const client = new Client({
host: envVars.dbHost,
port: 5432, //envVars.dbPort does not exist!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment