-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix (generator): correctly capitalise table named model (#515)
This PR fixes the bug for a table named "model", described by a user on [Discord](https://discord.com/channels/933657521581858818/933657523049885698/1156342498453639260). We were parsing the Prisma schema in order to capitalise model names but if the model name itself was "model" we would capitalise the "model" keyword instead of the model name "model". This is fixed by replacing the exact match in the string instead of replacing the first occurrence of the table name. Also extended the unit test to check this case.
- Loading branch information
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"electric-sql": patch | ||
--- | ||
|
||
Fix bug for table named "model" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters