|
1 | 1 | # sequelize-typescript
|
2 | 2 |
|
3 |
| -[](https://github.com/RobinBuschmann/sequelize-typescript/actions?query=workflow%3A%22Node.js+CI%22) |
4 |
| -[](https://codecov.io/gh/RobinBuschmann/sequelize-typescript) |
| 3 | +[](https://github.com/sequelize/sequelize-typescript/actions?query=workflow%3A%22Node.js+CI%22) |
| 4 | +[](https://codecov.io/gh/sequelize/sequelize-typescript) |
5 | 5 | [](https://www.npmjs.com/package/sequelize-typescript)
|
6 | 6 |
|
7 | 7 | Decorators and some other features for sequelize (v6).
|
8 | 8 |
|
9 |
| -- [sequelize-typescript](#sequelize-typescript) |
10 |
| - - [Installation](#installation) |
11 |
| - - [Sequelize Options](#sequelize-options) |
12 |
| - - [Scopes Options](#scopes-options) |
13 |
| - - [Model definition](#model-definition) |
14 |
| - - [Less strict](#less-strict) |
15 |
| - - [More strict](#more-strict) |
16 |
| - - [`@Table`](#table) |
17 |
| - - [Table API](#table-api) |
18 |
| - - [Primary key](#primary-key) |
19 |
| - - [`@CreatedAt`, `@UpdatedAt`, `@DeletedAt`](#createdat-updatedat-deletedat) |
20 |
| - - [`@Column`](#column) |
21 |
| - - [Column API](#column-api) |
22 |
| - - [_Shortcuts_](#shortcuts) |
23 |
| - - [Type inference](#type-inference) |
24 |
| - - [Accessors](#accessors) |
25 |
| - - [Usage](#usage) |
26 |
| - - [Configuration](#configuration) |
27 |
| - - [globs](#globs) |
28 |
| - - [Model-path resolving](#model-path-resolving) |
29 |
| - - [Build and create](#build-and-create) |
30 |
| - - [Find and update](#find-and-update) |
31 |
| - - [Model association](#model-association) |
32 |
| - - [One-to-many](#one-to-many) |
33 |
| - - [Many-to-many](#many-to-many) |
34 |
| - - [Type safe _through_-table instance access](#type-safe-through-table-instance-access) |
35 |
| - - [One-to-one](#one-to-one) |
36 |
| - - [`@ForeignKey`, `@BelongsTo`, `@HasMany`, `@HasOne`, `@BelongsToMany` API](#foreignkey-belongsto-hasmany-hasone-belongstomany-api) |
37 |
| - - [Multiple relations of same models](#multiple-relations-of-same-models) |
38 |
| - - [Type safe usage of auto generated functions](#type-safe-usage-of-auto-generated-functions) |
39 |
| - - [Indexes](#indexes) |
40 |
| - - [`@Index`](#index) |
41 |
| - - [Index API](#index-api) |
42 |
| - - [`createIndexDecorator()`](#createindexdecorator) |
43 |
| - - [Repository mode](#repository-mode) |
44 |
| - - [How to enable repository mode?](#how-to-enable-repository-mode) |
45 |
| - - [How to use repository mode?](#how-to-use-repository-mode) |
46 |
| - - [How to use associations with repository mode?](#how-to-use-associations-with-repository-mode) |
47 |
| - - [Limitations of repository mode](#limitations-of-repository-mode) |
48 |
| - - [Model validation](#model-validation) |
49 |
| - - [Exceptions](#exceptions) |
50 |
| - - [Example](#example) |
51 |
| - - [Scopes](#scopes) |
52 |
| - - [`@DefaultScope` and `@Scopes`](#defaultscope-and-scopes) |
53 |
| - - [Hooks](#hooks) |
54 |
| - - [Why `() => Model`?](#why---model) |
55 |
| - - [Recommendations and limitations](#recommendations-and-limitations) |
56 |
| - - [One Sequelize instance per model (without repository mode)](#one-sequelize-instance-per-model-without-repository-mode) |
57 |
| - - [One model class per file](#one-model-class-per-file) |
58 |
| - - [Minification](#minification) |
59 |
| - - [Contributing](#contributing) |
| 9 | +- [Installation](#installation) |
| 10 | +- [Model Definition](#model-definition) |
| 11 | + - [`@Table` API](#table-api) |
| 12 | + - [`@Column` API](#column-api) |
| 13 | +- [Usage](#usage) |
| 14 | + - [Configuration](#configuration) |
| 15 | + - [globs](#globs) |
| 16 | + - [Model-path resolving](#model-path-resolving) |
| 17 | +- [Model association](#model-association) |
| 18 | + - [One-to-many](#one-to-many) |
| 19 | + - [Many-to-many](#many-to-many) |
| 20 | + - [One-to-one](#one-to-one) |
| 21 | + - [`@ForeignKey`, `@BelongsTo`, `@HasMany`, `@HasOne`, `@BelongsToMany` API](#foreignkey-belongsto-hasmany-hasone-belongstomany-api) |
| 22 | + - [Generated getter and setter](#type-safe-usage-of-auto-generated-functions) |
| 23 | + - [Multiple relations of same models](#multiple-relations-of-same-models) |
| 24 | +- [Indexes](#indexes) |
| 25 | + - [`@Index` API](#index) |
| 26 | + - [`createIndexDecorator()` API](#createindexdecorator) |
| 27 | +- [Repository mode](#repository-mode) |
| 28 | + - [How to enable repository mode?](#how-to-enable-repository-mode) |
| 29 | + - [How to use repository mode?](#how-to-use-repository-mode) |
| 30 | + - [How to use associations with repository mode?](#how-to-use-associations-with-repository-mode) |
| 31 | + - [Limitations of repository mode](#limitations-of-repository-mode) |
| 32 | +- [Model validation](#model-validation) |
| 33 | +- [Scopes](#scopes) |
| 34 | +- [Hooks](#hooks) |
| 35 | +- [Why `() => Model`?](#why---model) |
| 36 | +- [Recommendations and limitations](#recommendations-and-limitations) |
60 | 37 |
|
61 | 38 | ## Installation
|
62 | 39 |
|
@@ -244,7 +221,7 @@ used together with the @Column annotation to make some attribute options easier
|
244 | 221 | | --------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
245 | 222 | | `@AllowNull(allowNull?: boolean)` | sets `attribute.allowNull` (default is `true`) |
|
246 | 223 | | `@AutoIncrement` | sets `attribute.autoIncrement=true` |
|
247 |
| -| `@Unique(options? UniqueOptions)` | sets `attribute.unique=true` | [UniqueOptions](https://github.com/RobinBuschmann/sequelize-typescript/blob/master/src/model/column/column-options/unique.ts#L3) | |
| 224 | +| `@Unique(options? UniqueOptions)` | sets `attribute.unique=true` | [UniqueOptions](https://github.com/sequelize/sequelize-typescript/blob/master/src/model/column/column-options/unique.ts#L3) | |
248 | 225 | | `@Default(value: any)` | sets `attribute.defaultValue` to specified value |
|
249 | 226 | | `@PrimaryKey` | sets `attribute.primaryKey=true` |
|
250 | 227 | | `@Comment(value: string)` | sets `attribute.comment` to specified string |
|
|
0 commit comments