TypeError: allowed.join is not a function (mysql migration:run issue))

Hi everyone!

I am a beginner in back-end development (especially with Adonis), and I got stucked in a error (TypeError: allowed.join is not a function) I have no idea how to resolve.

For my first Adonis 4 project, I correctly set up a mysql database with migrations, but at a certain point I wanted to change one of the tables, so I modified the migration file and used CLI command adonis migration:run, but nothing changed. So I tried again but using the command adonis migration:reset first, but everytime it gives me the mentioned error.

In details, this is what i get with adonis migration:run:

TypeError: allowed.join is not a function
    at ColumnCompiler_MySQL.enu (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\dialects\mysql\schema\columncompiler.js:72:32)
    at ColumnCompiler_MySQL.ColumnCompiler.getColumnType (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\columncompiler.js:87:44)
    at ColumnCompiler_MySQL.ColumnCompiler.compileColumn (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\columncompiler.js:76:65)
    at ColumnCompiler_MySQL.ColumnCompiler.toSQL (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\columncompiler.js:67:23)
    at C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\tablecompiler.js:62:16
    at Array.map (<anonymous>)
    at TableCompiler_MySQL.TableCompiler.create (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\tablecompiler.js:61:32)
    at TableCompiler_MySQL.TableCompiler.toSQL (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\tablecompiler.js:46:20)
    at TableBuilder.toSQL (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\tablebuilder.js:53:42)
    at SchemaCompiler_MySQL.createTable (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\compiler.js:65:23)
    at SchemaCompiler_MySQL.toSQL (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\compiler.js:48:26)
    at SchemaBuilder.toSQL (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\schema\builder.js:65:43)
    at C:\Users\paolo.cereda\projects\guitarcenter\node_modules\knex\lib\runner.js:39:32
    at tryCatcher (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\bluebird\js\release\util.js:16:23)
    at C:\Users\paolo.cereda\projects\guitarcenter\node_modules\bluebird\js\release\using.js:185:26
    at tryCatcher (C:\Users\paolo.cereda\projects\guitarcenter\node_modules\bluebird\js\release\util.js:16:23)

What does it mean?

1 Like

Try it with “adonis migration:refresh”

Doesn’t work anyway, it tells me Already at the last batch and after that the same error :frowning:

So what is inside the allow.join?

Okay, I take a look where there was the error and I found the problem was correlated to the method table.enu(), probably i’ve done something wrong there! Thx :slight_smile: