remove db
Former-commit-id: c33308517515da9de53d67dc7d01b9753d22e9a7
This commit is contained in:
3
.env
3
.env
@@ -14,4 +14,5 @@ DATABASE_PORT=5432
|
||||
DATABASE_DB=legolog
|
||||
DATABASE_DB_DEV=legologdev
|
||||
DATABASE_USER=postgres
|
||||
DATABASE_PASSWORD=postgres
|
||||
DATABASE_PASSWORD=password
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const Logger = require('../logger.js');
|
||||
const EntityFramework = require('./psql-entity-framework/entity-relationships.js');
|
||||
|
||||
const { Client } = require('pg');
|
||||
|
||||
@@ -43,21 +42,10 @@ class Database {
|
||||
});
|
||||
|
||||
await con;
|
||||
this.ORM = new EntityFramework(this.connection);
|
||||
return this.connection;
|
||||
}
|
||||
|
||||
async ORMReady() {
|
||||
await this.ORM.syncModels();
|
||||
}
|
||||
|
||||
get getORM() {
|
||||
return this.ORM;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
IDatabase: Database,
|
||||
DataTypes: require('./psql-entity-framework/types.js'),
|
||||
DataConstraints: require('./psql-entity-framework/relationships-constraints.js'),
|
||||
};
|
||||
|
||||
10
src/index.js
10
src/index.js
@@ -4,7 +4,8 @@ const Server = require('./routes/server.js');
|
||||
const API = require('./routes/api.js');
|
||||
|
||||
const Databse = require('./database/database.js');
|
||||
const ModelManager = require('./models/model-manager.js');
|
||||
|
||||
// TODO: The first time running needs to populate the database with the bricks and sets.
|
||||
|
||||
async function main() {
|
||||
Config.Load();
|
||||
@@ -17,11 +18,8 @@ async function main() {
|
||||
});
|
||||
Logger.Info('Pre-Init Complete');
|
||||
|
||||
// const Database = new Databse.IDatabase();
|
||||
// await Database.connect();
|
||||
|
||||
// ModelManager.Init(Database);
|
||||
// await Database.ORMReady();
|
||||
const Database = new Databse.IDatabase();
|
||||
await Database.connect();
|
||||
|
||||
Server.Listen(process.env.PORT);
|
||||
API.Init();
|
||||
|
||||
@@ -7,6 +7,7 @@ const Sets = require('./sets-router.js');
|
||||
const Query = require('./query-router.js');
|
||||
const Auth0 = require('./auth0-router.js');
|
||||
|
||||
// CRUD is implemented where it makes sense.
|
||||
function Init() {
|
||||
Server.App.get('/api/special/', Helpers.Special);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user