Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit 8dc7a7a

Browse files
committed
Merge branch 'release/1.4.0'
2 parents 4b109e4 + eed6d72 commit 8dc7a7a

17 files changed

+3190
-2564
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
extends: ['standard', 'plugin:prettier/recommended'],
3-
plugins: ['import', 'promise', 'mocha'],
3+
plugins: ['mocha'],
44
parserOptions: {
55
sourceType: 'module'
66
},

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ typings/
6262

6363
# macOS finder metadata
6464
.DS_Store
65+
66+
# VS Code config
67+
.vscode/

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See this handy, if ugly, [cheat sheet](http://danielkummer.github.io/git-flow-ch
1616
2. clone your fork to your local development machine
1717
3. Set this repo as the `upstream` repo `git remote add upstream <insert the upstream url>`
1818
4. Disallow direct pushing to upstream `git remote set-url --push upstream no_push`
19-
5. create a local `master` branch `git checkout -b master` and test it via `git pull upstream master`
19+
5. create a local `main` branch `git checkout -b main` and test it via `git pull upstream main`
2020
6. ensure you have installed the [`git-flow` command line helpers](https://github.com/nvie/gitflow) and [`git-flow-completion` utils](https://github.com/bobthecow/git-flow-completion) then run `git flow init -d`.
2121

2222
#### Optional Git Setup
@@ -46,15 +46,15 @@ git config user.email "[email protected]"
4646

4747
#### Hotfixes and Support branches
4848

49-
It's basically the same process but use the word `hotfix` or `support` instead of `feature`. `git flow` knows what to do. Just keep in mind that any changes are going to happen to your fork, and not the upstream repo. If you need to merge a `hotfix` into upstream master you may only do it va a reviewed pull request.
49+
It's basically the same process but use the word `hotfix` or `support` instead of `feature`. `git flow` knows what to do. Just keep in mind that any changes are going to happen to your fork, and not the upstream repo. If you need to merge a `hotfix` into upstream main you may only do it va a reviewed pull request.
5050

5151
### Releasing to production
5252

5353
1. `git flow release start {tag.number}` (using semantic versioning)
5454
2. commit any changes to version info in `package.json` then `git flow release publish {tag.number}`
55-
3. `git flow release finish {tag.number}` merges the release into `master` of your fork, tags it, merges that back into `develop` on your fork and removes the release branch.
56-
4. Now go back to GitHub and raise a Pull Request to merge the upstream master from your fork's `master` branch. When that goes through you are done.
57-
5. In your command-line go back and clean up any outstanding branches and `git pull upstream` your local `master` and `develop` branches to ensure everything on your local machine is up to date with everyone's changes.
55+
3. `git flow release finish {tag.number}` merges the release into `main` of your fork, tags it, merges that back into `develop` on your fork and removes the release branch.
56+
4. Now go back to GitHub and raise a Pull Request to merge the upstream main from your fork's `main` branch. When that goes through you are done.
57+
5. In your command-line go back and clean up any outstanding branches and `git pull upstream` your local `main` and `develop` branches to ensure everything on your local machine is up to date with everyone's changes.
5858

5959
Note you will **never** push changes directly to the upstream project, _only to your own fork_.
6060

README.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ const model = (sequelize, DataTypes) => {
7878
{
7979
indexes: [
8080
{ unique: true, fields: ['email'] },
81-
{ unique: true, fields: ['token'] }
81+
{ unique: true, fields: ['token'] },
82+
{ unique: false, fields: ['firstName', 'lastName'] }
8283
]
8384
}
8485
)
@@ -133,21 +134,32 @@ describe('src/models/User', () => {
133134
})
134135

135136
context('indexes', () => {
136-
;['email', 'token'].forEach(checkUniqueIndex(user))
137+
context('unique', () => {
138+
;['email', 'token'].forEach(checkUniqueIndex(user))
139+
})
140+
141+
context('non unique (and also composite in this example)', () => {
142+
;[['firstname', 'lastname']].forEach(checkNonUniqueIndex(user))
143+
})
137144
})
138145
})
139146
```
140147

141148
### Built-in checks
142149

143-
| Check | What it does |
144-
| -------------------------- | -------------------------------------------------------- |
145-
| `checkHookDefined` | Checks that a particular hook is defined. |
146-
| `checkModelName` | Checks that the model is named correctly. |
147-
| `checkNonUniqueIndex` | Checks that a specific non-unique index is defined. |
148-
| `checkPropertyExists` | Checks that the model has defined the given property. |
149-
| `checkUniqueCompoundIndex` | Checks that a specific unique compound index is defined. |
150-
| `checkUniqueIndex` | Checks that a specific unique index is defined. |
150+
| Check | What it does |
151+
| --------------------- | ----------------------------------------------------- |
152+
| `checkHookDefined` | Checks that a particular hook is defined. |
153+
| `checkModelName` | Checks that the model is named correctly. |
154+
| `checkNonUniqueIndex` | Checks that a specific non-unique index is defined. |
155+
| `checkPropertyExists` | Checks that the model has defined the given property. |
156+
| `checkUniqueIndex` | Checks that a specific unique index is defined. |
157+
158+
#### Deprecation notice
159+
160+
| Check | Note |
161+
| -------------------------- | ------------------------------------------------------ |
162+
| `checkUniqueCompoundIndex` | Use either `checkUniqueIndex` or `checkNonUniqueIndex` |
151163

152164
### Checking associations
153165

@@ -390,7 +402,7 @@ By default `makeMockModels` and `listModels` will both look for your models in f
390402
| Branch | Status | Coverage | Audit | Notes |
391403
| ------ | ------ | -------- | ----- | ----- |
392404
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/develop) | [![codecov](https://codecov.io/gh/davesag/sequelize-test-helpers/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/sequelize-test-helpers) | [![Vulnerabilities](https://snyk.io/test/github/davesag/sequelize-test-helpers/develop/badge.svg)](https://snyk.io/test/github/davesag/sequelize-test-helpers/develop) | Work in progress |
393-
| `master` | [![CircleCI](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/master.svg?style=svg)](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/master) | [![codecov](https://codecov.io/gh/davesag/sequelize-test-helpers/branch/master/graph/badge.svg)](https://codecov.io/gh/davesag/sequelize-test-helpers) | [![Vulnerabilities](https://snyk.io/test/github/davesag/sequelize-test-helpers/master/badge.svg)](https://snyk.io/test/github/davesag/sequelize-test-helpers/master) | Latest stable release |
405+
| `main` | [![CircleCI](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/main.svg?style=svg)](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/main) | [![codecov](https://codecov.io/gh/davesag/sequelize-test-helpers/branch/main/graph/badge.svg)](https://codecov.io/gh/davesag/sequelize-test-helpers) | [![Vulnerabilities](https://snyk.io/test/github/davesag/sequelize-test-helpers/main/badge.svg)](https://snyk.io/test/github/davesag/sequelize-test-helpers/main) | Latest stable release |
394406

395407
### Prerequisites
396408

0 commit comments

Comments
 (0)