0

I just decided to upgrade an existing Sails project to 1.0.0 and managed to get through most of the upgrade process until I tried connecting to the database. When attempting to lift this is the error I receive:

The adapter used by the default datastore is not compatible with the current version of Sails/Waterline.

The adapter should expose a valid adapterApiVersion.

If you're using the beta release of Sails 1.0, try:

npm install --save sails-disk@beta

My datastores.js file contains the following:

module.exports.datastores = {

  // In previous versions, datastores (then called 'connections') would only be loaded
  // if a model was actually using them.  Starting with Sails 1.0, _all_ configured
  // datastores will be loaded, regardless of use.  So we'll only include datastores in
  // this file that were actually being used.  Your original `connections`  config is
  // still available as `config/connections-old.js.txt`.

   'developmentPostgres': {
    adapter: require('sails-postgresql'),
    url: process.env.postgresHost,
    user: process.env.postgresUser,
    password: process.env.postgresPassword,
    database: process.env.postgresDatabase
  }

};

Where all of the values are provided as environment variables. "sails-postgresql": "^1.0.0" is installed and saved in package.json

models.js also contains the following line: datastore: 'developmentPostgres', which to my understanding means that all of my models should be using the above database by default.

Up until this point the upgrade process has been very straightforward. I assume I am just missing something simple here as well. I would appreciate any insight anyone can provide and would be happy to provide any additional information as well.

mtpeoples
  • 37
  • 5

1 Answers1

0

Turns out the project looks for a datastore labeled default. Changing the name to default in both datastore.js and model.js solved the issue.

mtpeoples
  • 37
  • 5