Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 850a4791
authored
Dec 09, 2018
by
Sushant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(migrations): improve dialect options docs
1 parent
2874c549
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
docs/migrations.md
lib/utils/validator-extras.js
package.json
docs/migrations.md
View file @
850a479
...
@@ -517,16 +517,14 @@ use the `--url` option to pass in a connection string. For example:
...
@@ -517,16 +517,14 @@ use the `--url` option to pass in a connection string. For example:
$
npx sequelize db:migrate --url
'mysql://root:password@mysql_host.com/database_name'
$
npx sequelize db:migrate --url
'mysql://root:password@mysql_host.com/database_name'
```
```
### Connecting over SSL
### Passing Dialect Specific Options
Ensure ssl is specified in both
`dialectOptions`
and in the base config.
```
json
```
json
{
{
"production"
:
{
"production"
:
{
"dialect"
:
"postgres"
,
"dialect"
:
"postgres"
,
"ssl"
:
true
,
"dialectOptions"
:
{
"dialectOptions"
:
{
"ssl"
:
tru
e
//
dialect
options
like
SSL
etc
her
e
}
}
}
}
}
}
...
...
lib/utils/validator-extras.js
View file @
850a479
...
@@ -64,12 +64,12 @@ const extensions = {
...
@@ -64,12 +64,12 @@ const extensions = {
};
};
exports
.
extensions
=
extensions
;
exports
.
extensions
=
extensions
;
/
** Instance based validators */
/
/ instance based validators
validator
.
isImmutable
=
function
(
value
,
validatorArgs
,
field
,
modelInstance
)
{
validator
.
isImmutable
=
function
(
value
,
validatorArgs
,
field
,
modelInstance
)
{
return
modelInstance
.
isNewRecord
||
modelInstance
.
dataValues
[
field
]
===
modelInstance
.
_previousDataValues
[
field
];
return
modelInstance
.
isNewRecord
||
modelInstance
.
dataValues
[
field
]
===
modelInstance
.
_previousDataValues
[
field
];
};
};
/
** Extra validators */
/
/ extra validators
validator
.
notNull
=
function
(
val
)
{
validator
.
notNull
=
function
(
val
)
{
return
val
!==
null
&&
val
!==
undefined
;
return
val
!==
null
&&
val
!==
undefined
;
};
};
...
...
package.json
View file @
850a479
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
"lint-staged"
:
"^7.3.0"
,
"lint-staged"
:
"^7.3.0"
,
"mariadb"
:
"^2.0.1-beta"
,
"mariadb"
:
"^2.0.1-beta"
,
"mocha"
:
"^5.x"
,
"mocha"
:
"^5.x"
,
"mysql2"
:
"^1.
x
"
,
"mysql2"
:
"^1.
6.4
"
,
"pg"
:
"^7.5.0"
,
"pg"
:
"^7.5.0"
,
"pg-hstore"
:
"^2.x"
,
"pg-hstore"
:
"^2.x"
,
"pg-types"
:
"^1.x"
,
"pg-types"
:
"^1.x"
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment