Skip to content

Commit

Permalink
Merge branch 'release/6.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Oct 1, 2018
2 parents 60619d2 + 0c1fcf9 commit 98c14e6
Show file tree
Hide file tree
Showing 34 changed files with 350 additions and 10,428 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _Put an `x` in the boxes that apply_

_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._

- [ ] I have read the [CONTRIBUTING](https://github.com/adonisjs/adonis-lucid/CONTRIBUTING.md) doc
- [ ] I have read the [CONTRIBUTING](https://github.com/adonisjs/adonis-lucid/blob/develop/CONTRIBUTING.md) doc
- [ ] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added necessary documentation (if appropriate)
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ test/functional/database
*.sublime-project
*.sublime-workspace
*.log
yarn.lock
build
dist
dist
yarn.lock
shrinkwrap.yaml
package-lock.json
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ node_js:
- node
- 8.0.0
sudo: false
services:
- mysql
before_install:
- mysql -e 'CREATE DATABASE testing_lucid;'
install:
- npm install
after_script:
- npm run coverage
notifications:
slack:
secure: >-
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
<a name="6.1.3"></a>
## [6.1.3](https://github.com/adonisjs/adonis-lucid/compare/v6.1.2...v6.1.3) (2018-10-01)


### Bug Fixes

* **database:** pagination counts query must use the subQuery of extended query builder ([b613b64](https://github.com/adonisjs/adonis-lucid/commit/b613b64)), closes [#378](https://github.com/adonisjs/adonis-lucid/issues/378)
* **database:** run database.raw on global transaction if exists ([a51ebe1](https://github.com/adonisjs/adonis-lucid/commit/a51ebe1)), closes [#374](https://github.com/adonisjs/adonis-lucid/issues/374)
* **model:** merge dirty attributes after the hooks have been called ([6bff452](https://github.com/adonisjs/adonis-lucid/commit/6bff452))
* **model:** use lodash isEqual to check if a model is dirty ([#384](https://github.com/adonisjs/adonis-lucid/issues/384)) ([88fe6ea](https://github.com/adonisjs/adonis-lucid/commit/88fe6ea))
* **query:** prefix table name to avoid ambiguous columns ([55fffb9](https://github.com/adonisjs/adonis-lucid/commit/55fffb9))


### Features

* **commands:** allow seeding db from migration run and refresh ([23dc3eb](https://github.com/adonisjs/adonis-lucid/commit/23dc3eb))
* **transaction:** add support for transactions in findOrCreate ([1e7b2a8](https://github.com/adonisjs/adonis-lucid/commit/1e7b2a8))



<a name="6.1.2"></a>
## [6.1.2](https://github.com/adonisjs/adonis-lucid/compare/v6.1.1...v6.1.2) (2018-08-24)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License

Copyright 2018 thetutlage, contributors
Copyright 2018 Harminder Virk, contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ install:
test_script:
- node --version
- npm --version
- 'npm run test:win'
- npm run test:win
build: 'off'
clone_depth: 1
matrix:
Expand Down
6 changes: 4 additions & 2 deletions commands/MigrationRefresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class MigrationRefresh extends BaseMigration {
migration:refresh
{ -f, --force: Forcefully run migrations in production }
{ -s, --silent: Silent the migrations output }
{ --seed: Seed the database after migration finished }
{ --log: Log SQL queries instead of executing them }
{ -a, --keep-alive: Do not close the database connection }
`
Expand Down Expand Up @@ -53,19 +54,20 @@ class MigrationRefresh extends BaseMigration {
* @param {Boolean} options.log
* @param {Boolean} options.force
* @param {Boolean} options.silent
* @param {Boolean} options.seed
* @param {Boolean} options.keepAlive
*
* @return {void|Array}
*/
async handle (args, { log, force, silent, keepAlive }) {
async handle (args, { log, force, silent, seed, keepAlive }) {
this._validateState(force)

if (keepAlive) {
this.migration.keepAlive()
}

await ace.call('migration:reset', {}, { log, force, silent })
await ace.call('migration:run', {}, { log, force, silent })
await ace.call('migration:run', {}, { log, force, silent, seed, keepAlive })
}
}

Expand Down
2 changes: 1 addition & 1 deletion commands/MigrationReset.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class MigrationReset extends BaseMigration {
* If there are queries in the result, just log them
*/
if (queries) {
_.each(queries, ({queries, name}) => {
_.each(queries, ({ queries, name }) => {
this.execIfNot(silent, () => console.log(this.chalk.magenta(`\n Queries for ${name}.js`)))
_.each(queries, (query) => this.execIfNot(silent, () => console.log(` ${query}`)))
console.log('\n')
Expand Down
2 changes: 1 addition & 1 deletion commands/MigrationRollback.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class MirationRollback extends BaseMigration {
* If there are queries in the result, just log them
*/
if (queries) {
_.each(queries, ({queries, name}) => {
_.each(queries, ({ queries, name }) => {
this.execIfNot(silent, () => console.log(this.chalk.magenta(`\n Queries for ${name}.js`)))
_.each(queries, (query) => this.execIfNot(silent, () => console.log(` ${query}`)))
console.log('\n')
Expand Down
14 changes: 12 additions & 2 deletions commands/MigrationRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
const BaseMigration = require('./BaseMigration')
const _ = require('lodash')
const prettyHrTime = require('pretty-hrtime')
const ace = require('@adonisjs/ace')

class MigrationRun extends BaseMigration {
/**
Expand All @@ -26,6 +27,7 @@ class MigrationRun extends BaseMigration {
migration:run
{ -f, --force: Forcefully run migrations in production }
{ -s, --silent: Silent the migrations output }
{ --seed: Seed the database after migration finished }
{ --log: Log SQL queries instead of executing them }
{ -a, --keep-alive: Do not close the database connection }
`
Expand Down Expand Up @@ -53,11 +55,12 @@ class MigrationRun extends BaseMigration {
* @param {Boolean} options.log
* @param {Boolean} options.force
* @param {Boolean} options.silent
* @param {Boolean} options.seed
* @param {Boolean} options.keepAlive
*
* @return {void|Array}
*/
async handle (args, { log, force, silent, keepAlive }) {
async handle (args, { log, force, silent, seed, keepAlive }) {
try {
this._validateState(force)

Expand Down Expand Up @@ -88,13 +91,20 @@ class MigrationRun extends BaseMigration {
* If there are queries in the result, just log them
*/
if (queries) {
_.each(queries, ({queries, name}) => {
_.each(queries, ({ queries, name }) => {
this.execIfNot(silent, () => console.log(this.chalk.magenta(`\n Queries for ${name}.js`)))
_.each(queries, (query) => this.execIfNot(silent, () => console.log(` ${query}`)))
console.log('\n')
})
}

/**
* If seed is passed, seed the DB after migration
*/
if (seed) {
await ace.call('seed', {}, { keepAlive, force })
}

if (!this.viaAce) {
return { status, migrated, queries }
}
Expand Down
2 changes: 1 addition & 1 deletion commands/MigrationStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MigrationStatus extends BaseMigration {
*
* @return {void|Array}
*/
async handle (args, {keepAlive}) {
async handle (args, { keepAlive }) {
if (keepAlive) {
this.migration.keepAlive()
}
Expand Down
9 changes: 4 additions & 5 deletions japaFile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict'

const cli = require('japa/cli')
require('./lib/iocResolver').setFold(require('@adonisjs/fold'))
cli.run('test/**/*.spec.js')
const { configure } = require('japa')
configure({
files: ['test/**/*.spec.js']
})
Loading

0 comments on commit 98c14e6

Please sign in to comment.