balderdashy/sails-mysql — pull request #17 by tauren (2013-05-05 08:04:05+00:00)
Title: Support mysql table name prefix

Adds support for mysql table prefixes. Adapters using sails-mysql can include a "prefix" property which will be prepended to the collection name. The collection name is not modified, but the mysql table name includes the prefix.

Example adapters.js:

```
mysql: {
module	: 'sails-mysql',
host	: 'localhost',
user	: 'myuser',
password	: 'mypass',
database	: 'mydb',
prefix	: 'sails_'
}
```

The `User` model will create a `sails_user` table.

Since I'm still getting familiar with the Sails codebase, this implementation does not modify any existing properties of collections, it just adds a new `tableName` property. The collection.identity stays `user`. Methods in MySQLAdapter that specify a database table name now use this property instead of the passed in collectionName property.