Skip to content

underscore / camelcase option should control all fields and table name generation #6423

Closed
@alexey2baranov

Description

@alexey2baranov

It would be great if sequelize will generate PostgreSQL DDL with lower_case_underscored table name and column names. By now underscore option manage foreign keys and create_at, modifed_at fields only.

In short

CREATE TABLE IF NOT EXISTS "Male" ("CamelCase" VARCHAR(255), "created_at" TIMESTAMP WITH TIME ZONE NOT NULL, "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL);

should become

CREATE TABLE IF NOT EXISTS male (camel_case VARCHAR(255), "created_at" TIMESTAMP WITH TIME ZONE NOT NULL, "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL);

my global config is

{
    "username": "",
    "password": "",
    "database": "",
    "host": "127.0.0.1",
    "dialect": "postgres",
    "define":{
      "paranoid":false,
      "timestamps":true,
      "freezeTableName": true,
      "underscored": true
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeFor issues and PRs. Changes that break compatibility and require a major version increment.type: featureDEPRECATED: replace with the "feature" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions