JavaScript Is the Promise argument passed into Knex migrations needed?

When running the command knex migrate:make table-name The below code is what appears in the newly created file.

exports.up = function (knex, Promise) {

  })
}

exports.down = function (knex, Promise) {
}

After I created my schema I noticed that I never used the Promise argument, provided by default (my code below).

exports.up = function (knex, Promise) {
  return knex.schema.createTable('Skills', (table) => {
    table.increments('id').primary()
    table.string('skill')
    table.string('description')
    table.integer('rating')
  })
}

exports.down = function (knex, Promise) {
  return knex.schema.dropTable('Skills')
}

I also had a look at other projects and realized I have never done anything with the Promise argument. Am I missing something? Or is it just provided by default and not always needed?

Answer:1

It is not needed for anything.

It is historical argument from the time, when node didn't have builtin promises (or maybe reminder from the time when knex allowed to select promise implementation that is used).

It is just an instance of bluebird (in knex 0.15.2).

Answer:2

Background I want to dynamically put some javascript code in a DIV element using innerHTML. For this, I create a DIV object on my page and two buttons. First button, when pressed should insert some ...

Background I want to dynamically put some javascript code in a DIV element using innerHTML. For this, I create a DIV object on my page and two buttons. First button, when pressed should insert some ...

First note that mod(3^146,293)=292. For some reason, inputting mod(3^146,293) in Matlab returns 275. Inputting Math.pow(3,146) % 293 in JS returns 275. This same error occurs (as far as I can tell) ...

First note that mod(3^146,293)=292. For some reason, inputting mod(3^146,293) in Matlab returns 275. Inputting Math.pow(3,146) % 293 in JS returns 275. This same error occurs (as far as I can tell) ...

In JavaScript, I have $scope.dtOptionsCandidate = DTOptionsBuilder.newOptions() .withColReorder() .withLightColumnFilter({ 1: {"type": "text"}, 2: {"type": "text"}, 3: ...

In JavaScript, I have $scope.dtOptionsCandidate = DTOptionsBuilder.newOptions() .withColReorder() .withLightColumnFilter({ 1: {"type": "text"}, 2: {"type": "text"}, 3: ...

  1. angular datatable filtering
  2. angular datatable filter dropdown
  3. angular datatable filter column
  4. angular datatable filter not working
  5. angular datatable filter data
  6. angular datatable filter each column
  7. angular material data table filtering
  8. angular-6-datatable filter
  9. angular 6 datatable filter example
  10. angular datatable custom filter
  11. angular 2 datatable filter example
  12. angular datatables column filter example
  13. angular 7 datatable filter
  14. angular 4 datatable filter
  15. angular 4 datatable filter example
  16. angular ngx-datatable filter
  17. angular 2 datatable filter
  18. angular 5 datatable filter
  19. angular p-datatable filter
  20. angular datatable search filter

I am using Firebase to authenticate users in our app using GoogleAuthProvider. But I don't want a new user to sign in if they are not already an authenticated user. If the user exists then sign them ...

I am using Firebase to authenticate users in our app using GoogleAuthProvider. But I don't want a new user to sign in if they are not already an authenticated user. If the user exists then sign them ...