@@ -65,7 +65,7 @@ should appear as a column in the database, require the `@Column` annotation.
65
65
66
66
### ` @Table `
67
67
The ` @Table ` annotation can be used without passing any parameters. To specify some more define options, use
68
- an object literal (all [ define options] ( http://docs.sequelizejs.com/en/v3/api/sequelize/#definemodelname-attributes-options-model )
68
+ an object literal (all [ define options] ( http://docs.sequelizejs.com/manual/tutorial/models-definition.html#configuration )
69
69
from sequelize are valid):
70
70
``` typescript
71
71
@Table ({
@@ -79,7 +79,7 @@ class Person extends Model<Person> {}
79
79
Decorator | Description
80
80
--------------------------------------|---------------------
81
81
` @Table ` | sets ` options.tableName=<CLASS_NAME> ` and ` options.modelName=<CLASS_NAME> ` automatically
82
- ` @Table(options: DefineOptions) ` | sets [ define options] ( http://docs.sequelizejs.com/en/v3/api/sequelize/#definemodelname-attributes-options-model ) (also sets ` options.tableName=<CLASS_NAME> ` and ` options.modelName=<CLASS_NAME> ` if not already defined by define options)
82
+ ` @Table(options: DefineOptions) ` | sets [ define options] ( http://docs.sequelizejs.com/manual/tutorial/models-definition.html#configuration ) (also sets ` options.tableName=<CLASS_NAME> ` and ` options.modelName=<CLASS_NAME> ` if not already defined by define options)
83
83
84
84
#### Primary key
85
85
A primary key (` id ` ) will be inherited from base class ` Model ` . This primary key is by default an ` INTEGER ` and has
@@ -124,7 +124,7 @@ import {DataType} from 'sequelize-typescript';
124
124
name : string ;
125
125
```
126
126
Or for a more detailed column description, use an object literal
127
- (all [ attribute options] ( http://docs.sequelizejs.com/en/v3/api/sequelize/#definemodelname-attributes-options-model )
127
+ (all [ attribute options] ( http://docs.sequelizejs.com/manual/tutorial/models-definition.html#configuration )
128
128
from sequelize are valid):
129
129
``` typescript
130
130
@Column ({
@@ -138,9 +138,9 @@ from sequelize are valid):
138
138
139
139
Decorator | Description
140
140
--------------------------------------|---------------------
141
- ` @Column ` | tries to infer [ dataType] ( http://docs.sequelizejs.com/en/v3/docs/ models-definition/ #data-types ) from js type
142
- ` @Column(dataType: DateType) ` | sets [ dataType] ( http://docs.sequelizejs.com/en/v3/docs/ models-definition/ #data-types ) explicitly
143
- ` @Column(options: AttributeOptions) ` | sets [ attribute options] ( http://docs.sequelizejs.com/en/v3/api/sequelize/#definemodelname-attributes-options-model )
141
+ ` @Column ` | tries to infer [ dataType] ( http://docs.sequelizejs.com/manual/tutorial/ models-definition.html #data-types ) from js type
142
+ ` @Column(dataType: DateType) ` | sets [ dataType] ( http://docs.sequelizejs.com/manual/tutorial/ models-definition.html #data-types ) explicitly
143
+ ` @Column(options: AttributeOptions) ` | sets [ attribute options] ( http://docs.sequelizejs.com/manual/tutorial/models-definition.html#configuration )
144
144
145
145
#### * Shortcuts*
146
146
If you're in love with decorators: * sequelize-typescript* provides some more of them. The following decorators can be
@@ -185,7 +185,7 @@ class Person extends Model<Person> {
185
185
186
186
## Usage
187
187
Except for minor variations * sequelize-typescript* will work like pure sequelize.
188
- (See sequelize [ docs] ( http://docs.sequelizejs.com/en/v3/docs/ models-usage/ ) )
188
+ (See sequelize [ docs] ( http://docs.sequelizejs.com/manual/tutorial/ models-usage.html ) )
189
189
### Configuration
190
190
To make the defined models available, you have to configure a ` Sequelize ` instance from ` sequelize-typescript ` (!).
191
191
``` typescript
@@ -233,7 +233,7 @@ person.save();
233
233
234
234
### Find and update
235
235
Finding and updating entries do also work like using native sequelize. So see sequelize
236
- [ docs] ( http://docs.sequelizejs.com/en/v3/docs/ models-usage/ ) for more details.
236
+ [ docs] ( http://docs.sequelizejs.com/manual/tutorial/ models-usage.html ) for more details.
237
237
``` typescript
238
238
Person
239
239
.findOne <Person >()
@@ -437,7 +437,7 @@ validation instead, you can do so by simply adding the validate options *as* dec
437
437
So that ` validate.isEmail=true ` becomes ` @IsEmail ` , ` validate.equals='value' ` becomes ` @Equals('value') `
438
438
and so on. Please notice, that a validator, that expects a boolean, is translated to an annotation without a parameter.
439
439
440
- See sequelize [ docs] ( http://docs.sequelizejs.com/en/v3/docs/ models-definition/ #validations )
440
+ See sequelize [ docs] ( http://docs.sequelizejs.com/manual/tutorial/ models-definition.html #validations )
441
441
for all validators.
442
442
443
443
### Exceptions
@@ -507,7 +507,7 @@ export class Shoe extends Model<Shoe> {
507
507
Scopes can be defined with annotations as well. The scope options are mostly the same like in native
508
508
sequelize except of the way how model classes are referenced. So instead of referencing them directly a getter
509
509
function ` () => Model ` is used instead.
510
- (See sequelize [ docs] ( http://docs.sequelizejs.com/en/v3/docs/ scopes/ ) for more details)
510
+ (See sequelize [ docs] ( http://docs.sequelizejs.com/manual/tutorial/ scopes.html ) for more details)
511
511
512
512
### ` @DefaultScope ` and ` @Scopes `
513
513
``` typescript
0 commit comments