-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Recipes
Igor Savin edited this page Oct 19, 2018
·
25 revisions
{encrypt: true}
should be included in options branch of connection configuration:
knex({
client : 'mssql',
connection: {
database: 'mydatabase',
server: 'myserver.database.windows.net',
user: 'myuser',
password: 'mypass',
port: 1433,
connectionTimeout: 30000,
options: {
encrypt: true
}
}
});
See all of node-mssql's connection options
In case you would like to use Knex.js changelog functionality to ensure you environments are only seeded once, but don't want to mix seed files with migration files, you can specify multiple directories as a source for your migrations:
await knex.migrate.latest({
directory: [
'src/services/orders/database/migrations',
'src/services/orders/database/seeds'
],
sortDirsSeparately: true,
tableName: ['orders_migrations'],
schemaName: 'orders',
})