db changes, refactoring with axios

This commit is contained in:
Mikayla Dobson
2022-11-23 09:46:35 -06:00
parent 20b13855ea
commit 7cc2851de7
3 changed files with 43 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
import { Client } from 'pg';
import dotenv from 'dotenv';
import populate from "./examplevals";
import populate from "./populate";
import pool from ".";
dotenv.config();
@@ -73,7 +73,7 @@ dotenv.config();
`
const recipecomments = `
CREATE TABLE IF NOT EXISTS recipin.cmp_recipecomments (
CREATE TABLE IF NOT EXISTS recipin.recipecomments (
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
commentbody varchar NOT NULL,
datecreated varchar NOT NULL,
@@ -122,7 +122,8 @@ dotenv.config();
await pool.query(s);
}
} catch(e: any) {
throw new Error(e);
console.error(e);
process.exit(0);
}
console.log("Database seed successful. Attempting to populate...");