'issue with sequelize package
export const Live = sequelize.define("tbl_live", {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
},
platform: DataTypes.STRING,
videoId: DataTypes.STRING,
title: DataTypes.STRING,
thumbnail: DataTypes.STRING,
viewers_count: DataTypes.INTEGER,
publishedAt: DataTypes.INTEGER,
status: DataTypes.STRING,
last_update: DataTypes.INTEGER,
}, {
timestamps: false,
})
When I try to execute this code
import { Live } from "./models/Live.model.js"
let live = await Live.findAll({})
console.log(live)
Error
[08-05-2022 02:35:39] [error] : Executing (default): SELECT `id`, `platform`, `videoId`, `title`, `thumbnail`, `viewers_count`, `publishedAt`, `status`, `last_update` FROM `tbl_lives` AS `tbl_live`;
I dont know why but sequelize is adding "s" at the end of table name
it does work, if i just change the table name to tbl_lives but still i wanna know why this doesn't work...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
