updates on database seed, popluates example vals

This commit is contained in:
Mikayla Dobson
2022-11-19 11:44:32 -06:00
parent 811158ec61
commit c6156e237e
5 changed files with 80 additions and 11 deletions

View File

@@ -1,5 +1,7 @@
import { Client } from 'pg';
import dotenv from 'dotenv';
import populate from "./examplevals";
dotenv.config();
(async function() {
@@ -14,9 +16,10 @@ dotenv.config();
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
firstname varchar NOT NULL,
lastname varchar NOT NULL,
handle varchar NOT NULL,
email varchar NOT NULL,
password varchar NOT NULL
handle varchar NOT NULL UNIQUE,
email varchar NOT NULL UNIQUE,
password varchar NOT NULL,
active boolean NOT NULL
);
`
@@ -97,5 +100,8 @@ dotenv.config();
throw new Error(e);
}
console.log("Database seed successful.");
console.log("Database seed successful. Attempting to populate...");
await populate();
process.exit(1);
})();