Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db seed with mysql database : Cannot read property 'concat' of undefined #728

Open
fiftoine opened this issue Jan 3, 2018 · 0 comments
Open

Comments

@fiftoine
Copy link

fiftoine commented Jan 3, 2018

  • Platform: Windows 10 64-bit
  • Database: Mysql
  • Lux Version: 1.2.2
  • Node Version: 8.9.3

Considering the following situation:

lux new testApp --database mysql
lux g resource user email:string password:string

Updated seed.js :

import User from 'app/models/user';

export default async function seed(trx) {
  await User.transacting(trx).create({
    email:'xxx@yyy.com',
    password: "password"
  })
}

Created test_app_dev mysql database

Called :
lux db:migrate

When calling

lux db:seed

I got the following error message :

TypeError: Cannot read property 'concat' of undefined
    at new Model (F:\workspace\lux\testApp7\dist\bundle.js:340:432)
    at new User (F:\workspace\lux\testApp7\dist\bundle.js:530:1)
    at F:\workspace\lux\testApp7\dist\bundle.js:340:3932
    at Generator.next (<anonymous>)
    at step (F:\workspace\lux\testApp7\dist\bundle.js:68:30)
    at F:\workspace\lux\testApp7\dist\bundle.js:86:14
    at new Promise (<anonymous>)
    at F:\workspace\lux\testApp7\dist\bundle.js:65:12
    at run (F:\workspace\lux\testApp7\dist\bundle.js:340:4926)
    at Function.create (F:\workspace\lux\testApp7\dist\bundle.js:340:4976)
    at Proxy.create (F:\workspace\lux\testApp7\dist\bundle.js:298:125)
    at F:\workspace\lux\testApp7\dist\bundle.js:623:33
    at Generator.next (<anonymous>)
    at step (F:\workspace\lux\testApp7\dist\bundle.js:68:30)
    at F:\workspace\lux\testApp7\dist\bundle.js:86:14
    at new Promise (<anonymous>)
From previous event:
    at F:\workspace\lux\testApp7\node_modules\knex\lib\transaction.js:93:14
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
From previous event:
    at Transaction_MySQL2.Transaction (F:\workspace\lux\testApp7\node_modules\knex\lib\transaction.js:64:41)
    at new Transaction_MySQL2 (F:\workspace\lux\testApp7\node_modules\knex\lib\dialects\mysql2\transaction.js:29:25)
    at Client_MySQL2.transaction (F:\workspace\lux\testApp7\node_modules\knex\lib\dialects\mysql2\index.js:60:12)
    at Function.transaction (F:\workspace\lux\testApp7\node_modules\knex\lib\util\make-knex.js:75:21)
    at Database.then.store (E:\Users\Antoine\AppData\Roaming\npm\node_modules\lux-framework\src\packages\cli\commands\dbseed.js:23:22)
    at <anonymous>
@fiftoine fiftoine changed the title db seed : Cannot read property 'concat' of undefined db seed with mysql database : Cannot read property 'concat' of undefined Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant