We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, as described in the title:
If i define a model with a default value for example in my case a UUID
var Media = sequelize.define('Media', { uuid: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true, allowNull: false }, someValue: DataTypes.STRING });
Then, if i create my entity using the fields option
Media.create({someValue: 'some value'}, { fields: ['someValue'] });
The field uuid is not "inserted"
INSERT INTO `Media` (`someValue`,`updatedAt`,`createdAt`) VALUES ('some value','2015-04-04 05:41:14','2015-04-04 05:41:14');
But if i set my "defaultValue" field into the fields option
Media.create({someValue: 'some value'}, { fields: ['uuid', 'someValue'] });
Everything "works fine"
INSERT INTO `Media` (`uuid`,`someValue`,`updatedAt`,`createdAt`) VALUES ('711544ee-691e-4f73-a9d5-9ef11273fa65','some value','2015-04-04 05:41:14','2015-04-04 05:41:14');
Using Sequelize 2.0.5 with MariaDB.
The text was updated successfully, but these errors were encountered:
Appears to be a bug. Code doesn't take into account non AI PKs for this case.
Sorry, something went wrong.
047acc4
I'm seeing this issue on 2.1.3 with sqlite
@LumberJ that version should have the fix, you'll need to provide more detail.
No branches or pull requests
Hello, as described in the title:
If i define a model with a default value for example in my case a UUID
Then, if i create my entity using the fields option
The field uuid is not "inserted"
But if i set my "defaultValue" field into the fields option
Everything "works fine"
Using Sequelize 2.0.5 with MariaDB.
The text was updated successfully, but these errors were encountered: