From c096ba89cc53df4d40e87748a4d143aa4e85bbc5 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Wed, 16 Sep 2020 10:30:34 +0100 Subject: [PATCH] feat(models): removed username field form user in dev environmnets, this will require a manual db reset (migrate:rollback, latest) --- knexfile.js | 7 ++++++- modules/core/migrations/000-core.js | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/knexfile.js b/knexfile.js index e7550b85a..a8eda0961 100644 --- a/knexfile.js +++ b/knexfile.js @@ -1,6 +1,11 @@ 'use strict' const fs = require( 'fs' ) const path = require( 'path' ) +const appRoot = require( 'app-root-path' ) + +// Load up .ENV file + +require( 'dotenv' ).config( { path: `${appRoot}/.env` } ) function walk( dir ) { let results = [ ] @@ -42,4 +47,4 @@ module.exports = { directory: migrationDirs } } -} \ No newline at end of file +} diff --git a/modules/core/migrations/000-core.js b/modules/core/migrations/000-core.js index 02e8fa29d..5eeda3304 100644 --- a/modules/core/migrations/000-core.js +++ b/modules/core/migrations/000-core.js @@ -20,7 +20,6 @@ exports.up = async knex => { // Users. await knex.schema.createTable( 'users', table => { table.string( 'id', 10 ).primary( ) - table.string( 'username', 20 ).unique( ).notNullable( ) table.timestamp( 'createdAt' ).defaultTo( knex.fn.now( ) ) table.string( 'name', 256 ).notNullable( ) table.string( 'bio' )