Replies: 12 comments 8 replies
-
@llong2195 great initiative :)
|
Beta Was this translation helpful? Give feedback.
-
@vygandas No problem, it seems I'm used to working with mix =)) |
Beta Was this translation helpful? Give feedback.
-
@llong2195 One more thing - since we do not use automatic sync and rely on migrations, we don't really need to put all these database column parameters. It won't generate types or won't do anything with the database itself. Unless I don't know something myself lol 😅 |
Beta Was this translation helpful? Give feedback.
-
@vygandas Just a few important parameters like |
Beta Was this translation helpful? Give feedback.
-
@vygandas It's scary to use auto-sync on a production environment 🤣 |
Beta Was this translation helpful? Give feedback.
-
@llong2195 so many things could go wrong with auto 🤣 |
Beta Was this translation helpful? Give feedback.
-
@vygandas As I described, this just makes it easier for us to monitor the database |
Beta Was this translation helpful? Give feedback.
-
@vygandas Considering the benefits it brings, should we use it? |
Beta Was this translation helpful? Give feedback.
-
@llong2195 I've started digging a bit to find more info. Take a look at this one https://www.reddit.com/r/laravel/comments/dd8l90/using_snake_case_database_fields_is_making/ . It's for Laravel, but practically, they are discussing the same problem. It is also reflecting the same concern I have regarding different naming conventions and consistency. |
Beta Was this translation helpful? Give feedback.
-
@vygandas Now both are fine. |
Beta Was this translation helpful? Give feedback.
-
@mantaskaveckas @algirdaspaskevicius @naftalimurgor @SpaceHolderdJs, what is your position on this? |
Beta Was this translation helpful? Give feedback.
-
I think that a naming convention should definitely be agreed, however, which one is a question of preference. Personally, I prefer https://stackoverflow.com/questions/2878248/postgresql-naming-conventions Additionally, if I remember correctly, TypeORM will add some additional data like "entity" in the table name, which I personally don't like. I think that database should have a structure, that is acceptable in the SQL environment, because there may be cases where you may interact with the database without ORM. Finally, there is no need to add column names manually, just use the SnakeNamingStrategy in the ORM config:
And in your ORM config, specify the naming strategy:
Note, that there are other naming strategies as well. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem?
I want to introduce the rules for naming entities and columns
This helps everything look clearer
I can monitor the column without having to go into the database or migration file to see it
Describe the solution you'd like
We have to code and rewrite a lot more, but compared to the benefits it seems great :)
Describe alternatives you've considered
No ideas
Additional context
Beta Was this translation helpful? Give feedback.
All reactions