exports.up = async (knex) => { await knex.schema.createTable('user', (table) => { table.string('public_key').primary() table.datetime('last_seen').notNullable() table.binary('name').nullable() table.binary('avatar').nullable() }) await knex.schema.createTable('room', (table) => { table.integer('id').primary() table.binary('name').notNullable() table.binary('room_key').notNullable() table.binary('avatar').nullable() }) await knex.schema.createTable('user_to_room', (table) => { table.string('user_public_key').references('public_key').inTable('user').notNullable() table.integer('room_id').references('id').inTable('room').notNullable() }) } exports.down = (knex) => knex.schema.dropTable('user')