Split apart DB init queries in tests

refs https://github.com/TryGhost/Toolbox/issues/213

- `better-sqlite3` doesn't like multiple queries in the same statement
  so we can make the change here to split them up ahead of the switch
This commit is contained in:
Daniel Lockyer 2022-03-28 16:17:17 +01:00
parent 65fa8c12b5
commit 32e2d15880
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD

View File

@ -193,8 +193,8 @@ async function setupDb() {
\`updated_by\` varchar(24) null,
primary key (\`id\`)
);
CREATE UNIQUE INDEX \`permissions_name_unique\` on \`permissions\` (\`name\`);\`);
`);
await knex.raw(`CREATE UNIQUE INDEX \`permissions_name_unique\` on \`permissions\` (\`name\`);`);
await knex.raw(`
CREATE TABLE \`permissions_roles\` (
@ -216,8 +216,8 @@ async function setupDb() {
\`updated_by\` varchar(24) null,
primary key (\`id\`)
);
CREATE UNIQUE INDEX \`roles_name_unique\` on \`roles\` (\`name\`);
`);
await knex.raw(`CREATE UNIQUE INDEX \`roles_name_unique\` on \`roles\` (\`name\`);`);
const date = knex.raw('CURRENT_TIMESTAMP');
await knex('roles').insert({