blixai / blix

⚙️🔧 CLI tool and scripting library to create, automate, and enhance Javascript applications
https://docs.blixjs.com
MIT License
26 stars 2 forks source link

fixed bookshelf model/migration script bug #332

Closed DBULL7 closed 6 years ago

DBULL7 commented 6 years ago

@alocke12992 I suspect this was a double whammy of errors. The folders didn't install correctly and then the script didn't exit when it detected something was wrong. Give it a shot by creating or adding a server with Postgres and try to make a model/migration.

alocke12992 commented 6 years ago

When creating a new backend project , and adding a model, the params passed in the console are being used to name the file and generate the model incorrectly. See the photo below;

screen shot 2018-09-28 at 8 31 00 am
alocke12992 commented 6 years ago

Looks like I may have found a different bug, after digging into the code a bit I noticed that you're setting table columns to process.argv.splice(3, process.argv.length) but the data needed to create the columns would come from splitting argv[2]. Here is the console.log of argv:

screen shot 2018-09-28 at 8 41 04 am
DBULL7 commented 6 years ago

I've made the bookshelf model script a bit more legible. I still can't reproduce your bug, did you pull the latest or perhaps used comma's?