Skip to content
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

Postgresql Migration - UUID Strategy Problems #9

Open
jacobfrantz1 opened this issue Jul 25, 2023 · 0 comments
Open

Postgresql Migration - UUID Strategy Problems #9

jacobfrantz1 opened this issue Jul 25, 2023 · 0 comments

Comments

@jacobfrantz1
Copy link

The commented out portion for the uuid strategy in the migration file (step 1) fails due to having the not null constraint.
await queryRunner.query(`ALTER TABLE "stock_movement" ADD "stockLocationId" uuid NOT NULL`);
should be
await queryRunner.query(`ALTER TABLE "stock_movement" ADD "stockLocationId" uuid`);

And the vendureV2Migrations function fails due to "product_variant_price.channelId" having the type "character varying" instead of uuid.

The subquery (SELECT "defaultCurrencyCode" FROM "channel" WHERE "id" = "channelId") needs channel id cast to uuid like (SELECT "defaultCurrencyCode" FROM "channel" WHERE "id" = "channelId"::uuid) when UUIDStrategy is used.

I don't think channelId should really be "character varying", it should probably be a foreign key with the type "uuid", but that isn't relevant to getting the migration to work.

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

No branches or pull requests

1 participant