I have 2 tables. 1 called events with an event ID and another table called tickets which I want to have primary keys of event ID and ticket ID. I am also using a PostgreSQL database. At the moment ,I have it as a foreign key but would like to have it as a primary key in the ticket table with the ticket ID.
knex.schema.createTable('events', function (table) {
table.increments('id');
table.string('eventName');
});
knex.schema.createTable('tickets', function (table) {
table.increments('id');
table.string('ticketName');
table.foreign('tickets').references('events_id').inTable('events');
});