test('createTable makes tables alright', async t => { await createTable(knexForTestsInMemory) const hasRecordsTable = await knexForTestsInMemory.schema.hasTable('records') const hasNotesTable = await knexForTestsInMemory.schema.hasTable('notes') const hasBothTables = hasRecordsTable && hasNotesTable t.true(hasBothTables) })
describe('Initializing', function () { it('Should create a database table for caching if it does not exist or empty existing one', async () => { if (await knex.schema.hasTable('cache')) { await knex.table('cache').del() } else { await knex.schema.createTable('cache', function (table) { table.string('key').unique() table.text('value') table.integer('expiration') }) } }) })