不要怂,就是干,撸起袖子干!

You need to sign in or sign up before continuing.
Commit 24cb00fe by rogerc

Added new config variable to return behaviour removed in v1.7.0rc6 to not plural…

…ize associated table names
1 parent d934bbaa
...@@ -132,7 +132,7 @@ module.exports = (function() { ...@@ -132,7 +132,7 @@ module.exports = (function() {
if (this.as) { if (this.as) {
this.isAliased = true; this.isAliased = true;
} else { } else {
this.as = Utils.pluralize(this.target.name, this.target.options.language); this.as = (this.options.freezeTableNameAssociations?this.target.tableName:Utils.pluralize(this.target.tableName, this.target.options.language));
} }
this.accessors = { this.accessors = {
......
...@@ -29,6 +29,7 @@ module.exports = (function() { ...@@ -29,6 +29,7 @@ module.exports = (function() {
classMethods: {}, classMethods: {},
validate: {}, validate: {},
freezeTableName: false, freezeTableName: false,
freezeTableNameAssociations: false,
underscored: false, underscored: false,
underscoredAll: false, underscoredAll: false,
paranoid: false, paranoid: false,
......
...@@ -342,6 +342,7 @@ module.exports = (function() { ...@@ -342,6 +342,7 @@ module.exports = (function() {
* @param {Boolean} [options.underscored=false] Converts all camelCased columns to underscored if true * @param {Boolean} [options.underscored=false] Converts all camelCased columns to underscored if true
* @param {Boolean} [options.underscoredAll=false] Converts camelCased model names to underscored tablenames if true * @param {Boolean} [options.underscoredAll=false] Converts camelCased model names to underscored tablenames if true
* @param {Boolean} [options.freezeTableName=false] If freezeTableName is true, sequelize will not try to alter the DAO name to get the table name. Otherwise, the dao name will be pluralized * @param {Boolean} [options.freezeTableName=false] If freezeTableName is true, sequelize will not try to alter the DAO name to get the table name. Otherwise, the dao name will be pluralized
* @param {Boolean} [options.freezeTableNameAssociations=false] If freezeTableNameAssociations is true, sequelize will not try to alter the DAO name to get the table name of the associated tables. Otherwise, the dao name will be pluralized
* @param {String|Boolean} [options.createdAt] Override the name of the createdAt column if a string is provided, or disable it if false. Timestamps must be true * @param {String|Boolean} [options.createdAt] Override the name of the createdAt column if a string is provided, or disable it if false. Timestamps must be true
* @param {String|Boolean} [options.updatedAt] Override the name of the updatedAt column if a string is provided, or disable it if false. Timestamps must be true * @param {String|Boolean} [options.updatedAt] Override the name of the updatedAt column if a string is provided, or disable it if false. Timestamps must be true
* @param {String|Boolean} [options.deletedAt] Override the name of the deletedAt column if a string is provided, or disable it if false. Timestamps must be true * @param {String|Boolean} [options.deletedAt] Override the name of the deletedAt column if a string is provided, or disable it if false. Timestamps must be true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!