[英]foreign key camel case issue in postgres on heroku server
i am creating table on heroku successfully but the problems is foreign key when add foreign key it will automatically created in small letter by default postgres accept foreign key like serviceId
format我在heroku上成功创建表,但问题是外键添加外键时,默认情况下它将自动以小写字母创建postgres接受类似serviceId
格式的外键
this is my table这是我的桌子
CREATE TABLE service_categories (
id serial PRIMARY KEY,
"serviceId" integer NOT NULL,
service_category_name VARCHAR ( 50 ) NOT NULL,
"createdAt" TIMESTAMP DEFAULT NOW(),
"updatedAt" TIMESTAMP DEFAULT NOW()
);
but on heroku its created serviceid
rather then serviceId
any body can help how can i create foreign key like serviceId
但是在heroku上它创建的serviceid
而不是serviceId
任何人都可以帮助我如何创建像serviceId
这样的外键
just double quotes in the model like只是模型中的双引号,例如
const Order = db.define("my_orders", {
id: {
type: Sequelize.INTEGER,
autoIncrement: true,
allowNull: false,
primaryKey: true,
},
"serviceSubCategoryId": {
type: Sequelize.INTEGER
},
"userId": {
type: Sequelize.INTEGER
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.