{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails/issues/3544","repository_url":"https://api.github.com/repos/balderdashy/sails","labels_url":"https://api.github.com/repos/balderdashy/sails/issues/3544/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails/issues/3544/comments","events_url":"https://api.github.com/repos/balderdashy/sails/issues/3544/events","html_url":"https://github.com/balderdashy/sails/issues/3544","id":131473092,"number":3544,"title":"v0.11.4 config/env/staging.js Config Ignored","user":{"login":"NikkiDreams","id":1399736,"avatar_url":"https://avatars.githubusercontent.com/u/1399736?v=3","gravatar_id":"","url":"https://api.github.com/users/NikkiDreams","html_url":"https://github.com/NikkiDreams","followers_url":"https://api.github.com/users/NikkiDreams/followers","following_url":"https://api.github.com/users/NikkiDreams/following{/other_user}","gists_url":"https://api.github.com/users/NikkiDreams/gists{/gist_id}","starred_url":"https://api.github.com/users/NikkiDreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikkiDreams/subscriptions","organizations_url":"https://api.github.com/users/NikkiDreams/orgs","repos_url":"https://api.github.com/users/NikkiDreams/repos","events_url":"https://api.github.com/users/NikkiDreams/events{/privacy}","received_events_url":"https://api.github.com/users/NikkiDreams/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/balderdashy/sails/labels/bug","name":"bug","color":"b11420"},{"url":"https://api.github.com/repos/balderdashy/sails/labels/more%20info%20please","name":"more info please","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-02-04T21:03:09Z","updated_at":"2016-02-05T19:12:45Z","closed_at":null,"body":"We have a multi-environment ecology with Staging thrown in there along with local, dev and prod. \r\nWhen we lift the server the staging config is read but the mysql adapter and connection and other config options are ignored. The default adapter which uses root@localhost is being pulled from, I assume, the sails-mysql module. It does not matter where we put the connections and model adapter config. It is never used. \r\n\r\nI have put both configs in their respective base config files and in the config/env/staging.js I even set log: 'silly' in the staging config file. It too is ignored. I have a console.log statement at the top of each config file. I see the correct files being read in based on each environment. But the staging config options are simply not used.\r\n\r\nSame results occur no matter how we lift the server\r\n```NODE_ENV=staging sails lift```\r\nor \r\n```NODE_ENV=staging npm start```\r\n\r\nWhether in config/... or config/env/... the options are not used. I confirmed this behavior on my own dev system as well as all of our remote servers and another developers dev system.\r\n```\r\nconnections: {\r\n    stagingMysqlServer: {\r\n      adapter: 'sails-mysql',\r\n      host: '<private ip>',\r\n      user: 'root',\r\n      password: 'xxxxx',\r\n      database: 'mydb'\r\n    }\r\n  }\r\n\r\nmodels: {\r\n    connection: 'stagingMysqlServer'\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/balderdashy/sails/issues/comments/180506409","html_url":"https://github.com/balderdashy/sails/issues/3544#issuecomment-180506409","issue_url":"https://api.github.com/repos/balderdashy/sails/issues/3544","id":180506409,"user":{"login":"NikkiDreams","id":1399736,"avatar_url":"https://avatars.githubusercontent.com/u/1399736?v=3","gravatar_id":"","url":"https://api.github.com/users/NikkiDreams","html_url":"https://github.com/NikkiDreams","followers_url":"https://api.github.com/users/NikkiDreams/followers","following_url":"https://api.github.com/users/NikkiDreams/following{/other_user}","gists_url":"https://api.github.com/users/NikkiDreams/gists{/gist_id}","starred_url":"https://api.github.com/users/NikkiDreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikkiDreams/subscriptions","organizations_url":"https://api.github.com/users/NikkiDreams/orgs","repos_url":"https://api.github.com/users/NikkiDreams/repos","events_url":"https://api.github.com/users/NikkiDreams/events{/privacy}","received_events_url":"https://api.github.com/users/NikkiDreams/received_events","type":"User","site_admin":false},"created_at":"2016-02-05T19:12:45Z","updated_at":"2016-02-05T19:12:45Z","body":"@sgress454 \r\n```\r\n/**\r\n * Staging environment settings\r\n *\r\n * This file can include shared settings for a production environment,\r\n * such as API keys or remote database passwords.  If you're using\r\n * a version control solution for your Sails app, this file will\r\n * be committed to your repository unless you add it to your .gitignore\r\n * file.  If your repository will be publicly viewable, don't add\r\n * any private information to this file!\r\n *\r\n */\r\n console.log(\"___STAGE___\");\r\nmodule.exports =  {\r\n\r\n  /***************************************************************************\r\n   * Set the default database connection for models in the production        *\r\n   * environment (see config/connections.js and config/models.js )           *\r\n   ***************************************************************************/\r\n\r\n  // models: {\r\n  //   connection: 'someMysqlServer'\r\n  // },\r\n\r\n  /***************************************************************************\r\n   * Set the port in the production environment to 80                        *\r\n   ***************************************************************************/\r\n\r\n  // port: 80,\r\n\r\n  /***************************************************************************\r\n   * Set the log level in production environment to \"silent\"                 *\r\n   ***************************************************************************/\r\n\r\n  connections: {\r\n    stagingMysqlServer: {\r\n      adapter: 'sails-mysql',\r\n      host: '123.123.123.123',\r\n      user: 'me',\r\n      password: 'xxxxxxxx',\r\n      database: 'xxxxxxxx'\r\n    }\r\n  },\r\n\r\n  local: {\r\n    port: 3001,\r\n    environment: 'staging'\r\n  },\r\n\r\n  blueprints: {\r\n    prefix: '/api',\r\n    restPrefix: '/v1',\r\n    jsonapi: {\r\n      sideload: true\r\n    }\r\n  },\r\n\r\n  models: {\r\n    connection: 'stagingMysqlServer',\r\n    migrate: 'alter',\r\n    autoCreatedAt: true,\r\n    autoUpdatedAt: true,\r\n    autoPK: true,\r\n    schema: false,\r\n    associations: {\r\n      list: \"link\",\r\n      detail: \"record\"\r\n    },\r\n    validations: {\r\n      ignoreProperties: [ 'includeIn' ]\r\n    }\r\n  },\r\n\r\n  log: {\r\n    level: 'error'\r\n  },\r\n\r\n  orm:{\r\n    _hookTimeout: 45000\r\n  }\r\n};\r\n\r\n```"}}