2017-08-04 16 views
0

Programmatic APIオプションを使用してsequelize-autoでcamelCaseカラム名を取得するにはどうすればよいですか?私はすでにこのように試してみた:sequelize-auto:プログラマティックAPIオプションのキャメルケース

const options = { 
    host: 'localhost', 
    dialect: 'mysql', 
    directory: './models', 
    port: '3306', 
    logging: false, 
    additional: { 
     camel: true, 
     timestamps: false 
    } 
} 

const options = { 
    host: 'localhost', 
    dialect: 'mysql', 
    directory: './models', 
    port: '3306', 
    logging: false, 
    camel: true, 
    additional: { 
     timestamps: false 
    } 
} 

しかし、これのどれも動いていないようにみえ、私が間違って何をやっていますか?

よろしくお願いいたします。あなたが接近しているように見えるhttps://github.com/sequelize/sequelize-auto/blob/master/lib/index.jsに基づいて

答えて

1

!あなただけの...ようcamelCasecamelオプションの名前を変更する

const options = { 
    host: 'localhost', 
    dialect: 'mysql', 
    directory: './models', 
    port: '3306', 
    logging: false, 
    camelCase: true, // <-- Do this! 
    additional: { 
     timestamps: false 
    } 
} 

幸運が必要です! :)

+0

ブルズアイ@ディランアスペン、どうもありがとう。 –

関連する問題