@@ -102,7 +102,7 @@ With `sequelize-typescript@1` comes a repository mode. See [docs](#repository-mo
102102import {Table , Column , Model , HasMany } from ' sequelize-typescript' ;
103103
104104@Table
105- class Person extends Model < Person > {
105+ class Person extends Model {
106106
107107 @Column
108108 name: string ;
@@ -128,7 +128,7 @@ from sequelize are valid):
128128 timestamps: true ,
129129 ...
130130})
131- class Person extends Model < Person > {}
131+ class Person extends Model {}
132132```
133133#### Table API
134134
@@ -223,7 +223,7 @@ Design type | Sequelize data type
223223Get/set accessors do work as well
224224``` typescript
225225@Table
226- class Person extends Model < Person > {
226+ class Person extends Model {
227227
228228 @Column
229229 get name(): string {
@@ -277,7 +277,7 @@ sequelize.addModels([__dirname + '/**/*.model.ts']);
277277A model is matched to a file by its filename. E.g.
278278``` typescript
279279// File User.ts matches the following exported model.
280- export class User extends Model < User > {}
280+ export class User extends Model {}
281281```
282282This is done by comparison of the filename against all exported members. The
283283matching can be customized by specifying the ` modelMatch ` function in the
@@ -308,7 +308,7 @@ export const UserN = 'Not a model';
308308export const NUser = ' Not a model' ;
309309
310310@Table
311- export class User extends Model < User > {
311+ export class User extends Model {
312312
313313 @Column
314314 nickname: string ;
@@ -325,7 +325,7 @@ user.model User -> true (User will be added as model)
325325Another way to match model to file is to make your model the default export.
326326
327327``` TypeScript
328- export default class User extends Model < User > {}
328+ export default class User extends Model {}
329329```
330330
331331> ⚠️ When using paths to add models, keep in mind that they will be loaded during runtime. This means that the path
@@ -374,7 +374,7 @@ and `@ForeignKey` annotations.
374374### One-to-many
375375``` typescript
376376@Table
377- class Player extends Model < Player > {
377+ class Player extends Model {
378378
379379 @Column
380380 name: string ;
@@ -391,7 +391,7 @@ class Player extends Model<Player> {
391391}
392392
393393@Table
394- class Team extends Model < Team > {
394+ class Team extends Model {
395395
396396 @Column
397397 name: string ;
@@ -415,20 +415,20 @@ the players will also be resolved (when passing `include: Player` to the find op
415415### Many-to-many
416416``` typescript
417417@Table
418- class Book extends Model < Book > {
418+ class Book extends Model {
419419 @BelongsToMany (() => Author , () => BookAuthor )
420420 authors: Author [];
421421}
422422
423423@Table
424- class Author extends Model < Author > {
424+ class Author extends Model {
425425
426426 @BelongsToMany (() => Book , () => BookAuthor )
427427 books: Book [];
428428}
429429
430430@Table
431- class BookAuthor extends Model < BookAuthor > {
431+ class BookAuthor extends Model {
432432
433433 @ForeignKey (() => Book )
434434 @Column
@@ -478,7 +478,7 @@ Note that when using AssociationOptions, certain properties will be overwritten
478478So if you define a model with multiple relations like
479479``` typescript
480480@Table
481- class Book extends Model < Book > {
481+ class Book extends Model {
482482
483483 @ForeignKey (() => Person )
484484 @Column
@@ -496,7 +496,7 @@ class Book extends Model<Book> {
496496}
497497
498498@Table
499- class Person extends Model < Person > {
499+ class Person extends Model {
500500
501501 @HasMany (() => Book )
502502 writtenBooks: Book [];
@@ -533,14 +533,14 @@ But TypeScript wont recognize them and will complain if you try to access `getMo
533533functions.
534534``` typescript
535535@Table
536- class ModelA extends Model < ModelA > {
536+ class ModelA extends Model {
537537
538538 @HasMany (() => ModelB )
539539 bs: ModelB [];
540540}
541541
542542@Table
543- class ModelB extends Model < ModelB > {
543+ class ModelB extends Model {
544544
545545 @BelongsTo (() => ModelA )
546546 a: ModelA ;
@@ -565,7 +565,7 @@ modelA.$create('bs', /* value */ ).then( /* ... */);
565565The ` @Index ` annotation can be used without passing any parameters.
566566``` typescript
567567@Table
568- class Person extends Model < Person > {
568+ class Person extends Model {
569569 @Index // Define an index with default name
570570 @Column
571571 name: string ;
@@ -580,7 +580,7 @@ To specify index and index field options, use
580580an object literal (see [ indexes define option] ( https://sequelize.org/v5/manual/models-definition.html#indexes ) ):
581581``` typescript
582582@Table
583- class Person extends Model < Person > {
583+ class Person extends Model {
584584 @Index (' my-index' ) // Define a multi-field index on name and birthday
585585 @Column
586586 name: string ;
@@ -639,7 +639,7 @@ const JobIndex = createIndexDecorator({
639639});
640640
641641@Table
642- class Person extends Model < Person > {
642+ class Person extends Model {
643643 @SomeIndex // Add name to SomeIndex
644644 @Column
645645 name: string ;
@@ -707,7 +707,7 @@ Nested scopes and includes in general won't work when using `@Scope` annotation
707707 }
708708}))
709709@Table
710- class User extends Model < User > {}
710+ class User extends Model {}
711711```
712712> ⚠️ This will change in the future: Simple includes will be implemented.
713713
@@ -733,7 +733,7 @@ Validator | Annotation
733733const HEX_REGEX = / ^ #([A-Fa-f0-9 ] {6} | [A-Fa-f0-9 ] {3} )$ / ;
734734
735735@Table
736- export class Shoe extends Model < Shoe > {
736+ export class Shoe extends Model {
737737
738738 @IsUUID (4 )
739739 @PrimaryKey
@@ -801,7 +801,7 @@ sequelize (See sequelize [docs](https://docs.sequelizejs.com/manual/tutorial/sco
801801 }
802802}))
803803@Table
804- export class ShoeWithScopes extends Model < ShoeWithScopes > {
804+ export class ShoeWithScopes extends Model {
805805
806806 @Column
807807 readonly secretKey: string ;
@@ -833,7 +833,7 @@ The name of the method cannot be the same as the name of the hook (for example,
833833
834834``` typescript
835835@Table
836- export class Person extends Model < Person > {
836+ export class Person extends Model {
837837 @Column
838838 name: string ;
839839
0 commit comments