I'm using Sequelize (6.3.0) with sqlite3 (4.2.0) for my database and I'm trying to define the following model :
this.define("giveaways", {
channel: {
type: Sq.STRING,
allowNull: false
},
message: {
type: Sq.STRING,
allowNull: false
},
name: {
type: Sq.STRING,
allowNull: false
},
end: {
type: Sq.DATE,
allowNull: false
},
participating: {
type: Sq.ARRAY(Sq.STRING),
allowNull: false,
defaultValue: []
},
winnersCount: {
type: Sq.NUMBER,
allowNull: false
},
winners: {
type: Sq.ARRAY(Sq.STRING),
allowNull: false,
defaultValue: []
},
finished: {
type: Sq.BOOLEAN,
allowNull: false,
defaultValue: false
},
host: {
type: Sq.STRING,
allowNull: false
}
});
It is supposed to be defined when process starts, but I get the following error :
(node:22440) UnhandledPromiseRejectionWarning: SequelizeDatabaseError: SQLITE_ERROR: near "[]": syntax error
And of course whenever I try to do any action to this table, I get follow error :
(node:22440) UnhandledPromiseRejectionWarning: SequelizeDatabaseError: SQLITE_ERROR: no such table: giveaways
I guess the problem comes from "participating" and "winners" rows that are using the ARRAY data type..
Thanks for your help