不要怂,就是干,撸起袖子干!

Commit 4023aa4f by Preston Parry

Docs- Wording changes on 'Defining A Model'

1 parent 6670246e
Showing with 3 additions and 4 deletions
...@@ -70,7 +70,7 @@ As this article is for beginners, we will skip migrations for now and take a clo ...@@ -70,7 +70,7 @@ As this article is for beginners, we will skip migrations for now and take a clo
### Defining a model ### Defining a model
In order to let Sequelize create a schemas in the database, you need to describe, what kind of data you want to store. This can be done with `sequelize.define`: In order to let Sequelize create schemas in the database, you need to describe what kind of data you want to store. This can be done with `sequelize.define`:
```js ```js
var User = sequelize.define('User', { var User = sequelize.define('User', {
...@@ -79,7 +79,7 @@ var User = sequelize.define('User', { ...@@ -79,7 +79,7 @@ var User = sequelize.define('User', {
}); });
``` ```
This will define a user model that has a username and password. Furthermore, Sequelize will automatically add the columns `id`, `createdAt` and `updatedAt`. `createdAt` and `updatedAt` are controlled by sequelize - when you `create` a model through sequelize `createdAt` will be set, and whenever you call `updateAttributes` / `save` on a model, `updatedAt` will be set. This will define a user model that has a username and password. Furthermore, Sequelize will automatically add the columns `id`, `createdAt` and `updatedAt`. `createdAt` and `updatedAt` are controlled by Sequelize - when you `create` a model through Sequelize, `createdAt` will be set, and whenever you call `updateAttributes` / `save` on a model, `updatedAt` will be set.
### Synchronizing the schema ### Synchronizing the schema
...@@ -387,4 +387,4 @@ As there are some more advanced features in Sequelize which are a bit inappropri ...@@ -387,4 +387,4 @@ As there are some more advanced features in Sequelize which are a bit inappropri
[2]: /docs/latest/models#configuration [2]: /docs/latest/models#configuration
[3]: /docs/latest/models#validations [3]: /docs/latest/models#validations
[4]: /docs/latest/models#finders [4]: /docs/latest/models#finders
[5]: /docs/latest/associations [5]: /docs/latest/associations
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!