0

I'm trying to use sails js with a SQL Server database, and when try to connect after created a dbo.AREA model and controller, sails says:

error: Hook failed to load: orm (RequestError: There is already an object named 'area' in the database.)
error: Error encountered while loading Sails core!
error: RequestError: There is already an object named 'area' in the database.

The model code is:

module.exports = {
   attributes: {
    CODIGO_CC: 'string',
    CODIGO_AREA: 'string',
    NOMBRE_AREA: 'string',
   }
};

and I have another question how can handle the primary keys, because the database doesn't have id column.

regards

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Your first question has been answered [here](http://stackoverflow.com/questions/20490853/stop-the-auto-migration-of-the-schema-in-the-sailsjs). – sgress454 Jun 03 '14 at 17:36
  • As for your second question, if you can't find an answer on SO or the [new Sails docs](http://beta.sailsjs.org/#/documentation/reference/Models/Attributes.html), please post it as a separate question so that it can help others! – sgress454 Jun 03 '14 at 17:37
  • Thanks Scott!!migrate: 'safe', was the solution! – Mikel David Carozzi Sanchez Jun 04 '14 at 00:47

0 Answers0