Skip to content

Conversation

StyleT
Copy link
Contributor

@StyleT StyleT commented May 5, 2021

No description provided.

@StyleT StyleT requested a review from nightnei May 5, 2021 17:15
@StyleT StyleT force-pushed the feature/optional_orderPos_in_routes branch from e3db1b5 to 8c5c30e Compare May 5, 2021 17:24
@StyleT StyleT force-pushed the feature/optional_orderPos_in_routes branch from 8c5c30e to f3459c0 Compare May 5, 2021 17:31
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;");
Copy link
Contributor

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?

Copy link
Contributor Author

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');
Copy link
Contributor

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?

Copy link
Contributor Author

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');
Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@nightnei nightnei self-requested a review May 6, 2021 10:16
@StyleT StyleT merged commit 7c5d912 into master May 6, 2021
@StyleT StyleT deleted the feature/optional_orderPos_in_routes branch May 6, 2021 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants