How to make Sequelize use singular table names
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Sequelize pluralizes model names by default, so a model named User typically maps to a table named Users. If your schema uses singular table names, or you want strict control over naming, you need to override that convention explicitly instead of relying on the default inflector.
Use freezeTableName on a Model
The most direct fix is to set freezeTableName: true in the model definition. That tells Sequelize to use the model name as the table name without pluralizing it.
With that option, the table name stays User instead of becoming Users.
This is often enough when you only need singular names for a few models or when you are integrating with an existing schema.
Set It Globally for the Whole Sequelize Instance
If you want the same rule everywhere, configure it once in the Sequelize constructor under define.
This is cleaner than repeating the same option on every model when the project has a consistent naming policy.
Use tableName When You Need Exact Control
Sometimes singular naming is only part of the requirement. You may need lowercase names, snake case, or a legacy table name that does not match the model at all. In that case, specify tableName directly.
tableName is the strongest override because it tells Sequelize the exact table to use. freezeTableName just prevents pluralization of the model name.
In other words:
- use
freezeTableNamewhen the model name already matches the table name you want - use
tableNamewhen the database name needs to be specified exactly
Keep Models, Migrations, and Associations Aligned
Changing table naming rules affects more than model definitions. Migrations, seeders, and associations also need to agree with the same table names.
For example, a migration creating a singular table might look like this:
If the model expects User but the migration created Users, the ORM configuration looks correct while queries still fail at runtime.
Associations also deserve a quick check. Relationship helpers may generate foreign key names or alias assumptions that reflect model naming, so verify the generated SQL if your schema is strict.
Prefer Explicit Naming Over Guessing
The deeper rule is this: if naming matters, make it explicit. Default pluralization is convenient for greenfield apps, but legacy databases and team conventions usually benefit from direct configuration. freezeTableName and tableName exist so you do not have to guess how the inflector will interpret every model name.
That explicitness also helps new developers. They can read the model definition and immediately see the real database table instead of deducing it from conventions.
Common Pitfalls
- Setting
freezeTableNameon one model but forgetting the rest creates a mixed naming scheme that is hard to maintain. - Expecting
freezeTableNameto rename an existing database table is incorrect. It only changes how Sequelize maps the model. - Updating model definitions without updating migrations causes runtime failures because the ORM and schema disagree.
- Assuming
freezeTableNameis enough for custom lowercase or legacy names is risky. UsetableNamewhen the exact name matters. - Ignoring generated association behavior can produce confusing foreign key or join-table names in stricter schemas.
Summary
- Sequelize pluralizes table names by default unless you override the behavior.
- Use
freezeTableName: trueto keep the model name singular. - Set the option globally under
definewhen the whole project follows the same rule. - Use
tableNamefor exact control over the database table name. - Keep models, migrations, and associations aligned so the naming rule is consistent everywhere.

