// The unique property is simply a shorthand to create a unique constraint.
// The unique property is simply a shorthand to create a unique constraint.
someUnique:{type:Sequelize.STRING,unique:true},
someUnique:{type:Sequelize.STRING,unique:true},
// It's exactly the same as creating the index in the model's options.
// It's exactly the same as creating the index in the model's options.
{someUnique:{type:Sequelize.STRING}},
{someUnique:{type:Sequelize.STRING}},
{indexes:[{unique:true,fields:['someUnique']}]},
{indexes:[{unique:true,fields:['someUnique']}]},
...
@@ -74,7 +74,7 @@ The comment option can also be used on a table, see [model configuration][0]
...
@@ -74,7 +74,7 @@ The comment option can also be used on a table, see [model configuration][0]
## Timestamps
## Timestamps
By default, Sequelize will add the attributes `createdAt` and `updatedAt` to your model so you will be able to know when the database entry went into the db and when it was updated last.
By default, Sequelize will add the attributes `createdAt` and `updatedAt` to your model so you will be able to know when the database entry went into the db and when it was updated last.
Note that if you are using Sequelize migrations you will need to add the `createdAt` and `updatedAt` fields to your migration definition:
Note that if you are using Sequelize migrations you will need to add the `createdAt` and `updatedAt` fields to your migration definition: