We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CREATE TABLE `asset_list` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `type` enum('video','audio','image') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'video', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
static initModel(sequelize: Sequelize.Sequelize): typeof asset_list { return sequelize.define( 'asset_list', { id: { autoIncrement: true, type: DataTypes.INTEGER.UNSIGNED, allowNull: false, primaryKey: true, }, type: { type: DataTypes.BLOB, // this is error allowNull: false, defaultValue: 'video', },
When I change sql to the following:
CREATE TABLE `asset_list` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `type` enum('video','audio','img') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'video', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Rename the image to img, and the data generated is correct.
image
img
static initModel(sequelize: Sequelize.Sequelize): typeof asset_list { return sequelize.define( 'asset_list', { id: { autoIncrement: true, type: DataTypes.INTEGER.UNSIGNED, allowNull: false, primaryKey: true, }, type: { type: DataTypes.ENUM('video', 'audio', 'img'), allowNull: false, defaultValue: 'video', },
The text was updated successfully, but these errors were encountered:
No branches or pull requests
static initModel(sequelize: Sequelize.Sequelize): typeof asset_list {
return sequelize.define(
'asset_list',
{
id: {
autoIncrement: true,
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
primaryKey: true,
},
type: {
type: DataTypes.BLOB, // this is error
allowNull: false,
defaultValue: 'video',
},
When I change sql to the following:
Rename the
image
toimg
, and the data generated is correct.static initModel(sequelize: Sequelize.Sequelize): typeof asset_list {
return sequelize.define(
'asset_list',
{
id: {
autoIncrement: true,
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
primaryKey: true,
},
type: {
type: DataTypes.ENUM('video', 'audio', 'img'),
allowNull: false,
defaultValue: 'video',
},
The text was updated successfully, but these errors were encountered: