-
Notifications
You must be signed in to change notification settings - Fork 46
Feature/optional order pos in routes #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e3db1b5
to
8c5c30e
Compare
8c5c30e
to
f3459c0
Compare
if (isMySQL(knex)) { | ||
return knex.raw("ALTER TABLE routes ADD domainIdIdxble int(11) GENERATED ALWAYS AS (coalesce(domainId, -1)) STORED;"); | ||
} else { | ||
return knex.raw("ALTER TABLE routes ADD COLUMN domainIdIdxble INT GENERATED ALWAYS AS (coalesce(domainId, -1)) VIRTUAL;"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you use "VIRTUAL" since it's the only way to alter a table in sqlite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
export async function up(knex: Knex): Promise<void> { | ||
return knex.schema.alterTable('routes', table => { | ||
table.dropUnique(['route', 'domainId'], 'routes_route_and_domainId_unique'); | ||
table.unique(['route', 'domainIdIdxble'], 'routes_route_and_domainIdIdxble_unique'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Idxble" - what does it mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indexable
|
||
export async function down(knex: Knex): Promise<void> { | ||
if (!isMySQL(knex)) { | ||
throw new Error('Not implemented'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it break the downing of migrations from this one?
@@ -14,15 +14,19 @@ const testUser = Object.freeze({ | |||
describe('Versioning Unit', () => { | |||
let db: VersionedKnex; | |||
let versionSevice: Versioning; | |||
before(async () => { | |||
before(async function() { | |||
this.timeout(10 * 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which changes caused setting this timeout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once I had build failed because of the timeout error.
No description provided.