error: `migration:run` is not a registered comman
I Got this after following the installation instruction. node --version v8.10.0
@barak-haviv what is your node version?
same here,
adonis cli: 4.0.4 node: v9.10.1 npm: 5.6.0
on mac OS High Sierra - 10.13.2 Homebrew 1.5.13
@barak-haviv change "version": "4.1", to "version": "4.1.5",
in package.json
and migration works, but with warnings...:
Knex:warning - Use async .hasTable to check if table exists and then use plain .createTable. Since .createTableIfNotExists actually just generates plain "CREATE TABLE IF NOT EXIST..." query it will not work correctly if there are any alter table queries generated for columns afterwards. To not break old migrations this function is left untouched for now, but it should not be used when writing new code and it is removed from documentation. Knex:warning - Use async .hasTable to check if table exists and then use plain .createTable. Since .createTableIfNotExists actually just generates plain "CREATE TABLE IF NOT EXIST..." query it will not work correctly if there are any alter table queries generated for columns afterwards. To not break old migrations this function is left untouched for now, but it should not be used when writing new code and it is removed from documentation. Knex:warning - Use async .hasTable to check if table exists and then use plain .createTable. Since .createTableIfNotExists actually just generates plain "CREATE TABLE IF NOT EXIST..." query it will not work correctly if there are any alter table queries generated for columns afterwards. To not break old migrations this function is left untouched for now, but it should not be used when writing new code and it is removed from documentation.
@barak-haviv @2peter3 thanks. For the warnings, it's from a knex lib used by @adonisjs/lucid. i don't know the cause but an issue has been raised https://github.com/iamraphson/adonisjs-hackathon-starter/issues/4
@barak-haviv @2peter3 the warning is normal according to https://github.com/adonisjs/adonis-lucid/issues/304 so I will close this issue.
@iamraphson It's probably better to do as recommended, change migrations to:
if (!this.hasTable('users')) { this.createTable('users', table => {
to prevent the warning message.
As a sidenote sqlite can't consume your alter table command, since it's not supporting alter.
Lastly, to be able to run it out of the box you might want to add "sqlite3": "^4.0.1", to package.json
**EDIT: createTable does not work anymore, it's create now. hasTable is an async method, so perhaps use createIfNotExists and dropIfExists
**EDIT2: Well, that will give a knex warning, they suggest use hasTable, so it needs a const exists = await this.hasTable('users')