angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Recently generated app doesn't have Things on sqldb #1228

Closed drochag closed 9 years ago

drochag commented 9 years ago

The server/config/sqldb/index.js comes with this in the start.

/**
 * Sequelize initialization module
 */

'use strict';

var path = require('path');
var config = require('../config/environment');

var Sequelize = require('sequelize');

var db = {
  Sequelize: Sequelize,
  sequelize: new Sequelize(config.sequelize.uri, config.sequelize.options)
};

// Insert models below

module.exports = db;

Doesn't include the Thing import making this code db.Thing = db.sequelize.import('../api/thing/thing.model'); needed or a new endpoint thing to be created.

kingcody commented 9 years ago

@DanMMX what version of the generator? Also could you post your .yo-rc.json?

The only way I have been able to reproduce this is by selecting both mongoose and sequelize, but then selecting mongoose as the default for the models.

drochag commented 9 years ago

I selected only sequelize (99% sure)

{
  "generator-angular-fullstack": {
    "endpointDirectory": "server/api/",
    "insertRoutes": true,
    "registerRoutesFile": "server/routes.js",
    "routesNeedle": "// Insert routes below",
    "routesBase": "/api/",
    "pluralizeRoutes": true,
    "insertSockets": true,
    "registerSocketsFile": "server/config/socketio.js",
    "socketsNeedle": "// Insert sockets below",
    "insertModels": true,
    "registerModelsFile": "server/sqldb/index.js",
    "modelsNeedle": "// Insert models below",
    "filters": {
      "js": true,
      "babel": true,
      "jade": true,
      "less": true,
      "uirouter": true,
      "bootstrap": true,
      "uibootstrap": true,
      "socketio": true,
      "models": true,
      "sequelizeModels": true,
      "sequelize": true,
      "grunt": true,
      "jasmine": true,
      "mocha": false,
      "should": false,
      "expect": false
    }
  },
  "generator-ng-component": {
    "routeDirectory": "client/app/",
    "directiveDirectory": "client/app/",
    "filterDirectory": "client/app/",
    "serviceDirectory": "client/app/",
    "basePath": "client",
    "moduleName": "",
    "filters": [
      "uirouter",
      "jasmine",
      "uirouter"
    ],
    "extensions": [
      "babel",
      "js",
      "jade",
      "less"
    ],
    "directiveSimpleTemplates": "",
    "directiveComplexTemplates": "",
    "filterTemplates": "",
    "serviceTemplates": "",
    "factoryTemplates": "",
    "controllerTemplates": "",
    "decoratorTemplates": "",
    "providerTemplates": "",
    "routeTemplates": ""
  }
}

and using the latest canary branch, I guess ~3.0.0-rc5

kingcody commented 9 years ago

@DanMMX are the generator ' deps up to date?

drochag commented 9 years ago

ah, npm install on the generator folder?

kingcody commented 9 years ago

I actually meant for the generator. If you're tracking via git then you wont get any updated modules when you git pull; so I was just checking that you had updated the generator's deps recently.

drochag commented 9 years ago

yep, I ran npm install after pulling and nothing new was installed, anything else I should run?

kingcody commented 9 years ago

I'm not really sure at this point. I can't seem to reproduce the issue.

drochag commented 9 years ago

Well, just pulled, npm installed and generated another one and works correctly, closing this.

For anyone coming up around this issue is enough to add Thing into server/config/sqldb/index.js or yo angular-fullstack:endpoint thing to rebuild the same model.