0
exports.up = function(knex) {
    return knex.schema.createTable('friend_list', (table) => {
        table.increments('id')
        table.integer('friend_id').references('user.id').notNullable()
        table.integer('friender_id').references('user.id').notNullable()
    })
};

I'm trying to make it so there can only be one unique pair of both of id's given

 { 
   user_id: 1, user_id: 2,
   user_id: 2, user_id: 1 // this then wouldn't work......
 }
Misterjoe
  • 128
  • 2
  • 10

0 Answers0