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

fix(data-store): add support for entityPrefix #725

Merged
merged 4 commits into from
Oct 25, 2021

Conversation

mirceanis
Copy link
Member

@mirceanis mirceanis commented Oct 21, 2021

fixes #724

I use the Entity metadata that TypeORM provides (which includes the entityPrefix configured on the connection) to decide on the database table names for migrations.

Users that use entityPrefix MUST skip the upgrade from 2.x to 3.0.0 and jump straight to the version that includes this fix!

I merged the pre-migration database fixtures into a single db and added another fixture to test migrations when entityPrefix is used.

This PR also contains some doc fixes for some core types and a workaround for a bug in the api-extractor toolchain that introduces some whitespace in {@link URLs}.
Also, the default infuraProjectId used in testing is updated.

@mirceanis mirceanis changed the title fix: add support for entityPrefix fix(data-store): add support for entityPrefix Oct 21, 2021
@@ -50,6 +50,7 @@ function createSchema(generator: TJS.SchemaGenerator, symbol: string) {
schemaStr = schemaStr.replace(/Where\<(.*)\>/gm, 'Where-$1')
schemaStr = schemaStr.replace(/Order\<(.*)\>/gm, 'Order-$1')
schemaStr = schemaStr.replace(/FindArgs\<(.*)\>/gm, 'FindArgs-$1')
schemaStr = schemaStr.replace(/https \:\/\//gm, 'https://')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhere in the api-extractor toolchain there is a bug that introduces a space between https and ://.
This is a workaround.

@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

Merging #725 (89fd76c) into next (88264db) will increase coverage by 11.45%.
The diff coverage is 76.01%.

@@             Coverage Diff             @@
##             next     #725       +/-   ##
===========================================
+ Coverage   67.58%   79.03%   +11.45%     
===========================================
  Files          62       85       +23     
  Lines        1530     2609     +1079     
  Branches      247      447      +200     
===========================================
+ Hits         1034     2062     +1028     
- Misses        400      545      +145     
+ Partials       96        2       -94     

Copy link
Contributor

@rkreutzer rkreutzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 90 in createPrivateKeyStorage needs the prefix

Copy link
Contributor

@simonas-notcat simonas-notcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@mirceanis
Copy link
Member Author

Line 90 in createPrivateKeyStorage needs the prefix

great catch!

@mirceanis mirceanis merged commit 801bb95 into next Oct 25, 2021
@mirceanis mirceanis deleted the 724-support-entity-prefix branch October 25, 2021 13:56
@mirceanis mirceanis mentioned this pull request Nov 12, 2021
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.

Data-store migrations don't support entityPrefix
3 participants