Photo by Chris Brignola on Unsplash

Stranger Problem I met with unique index

import Knex from ‘knex’
const knex = Knex(…)
// create the table
knex.schema.createTable(‘People’, function(t) {
t.string(‘name’).notNullable()
t.string(‘title’)
t.unique([‘name’, ‘title’])
})

Ron Liu

Full Stack Dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store