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
Rename models
and model_schema
#1297
Comments
What do you think @onecreative ? |
As much as I fought for models, I think you are correct. The system has simplified enough that we don’t need special names for this. Agreed. This is actually a sign that things are going in the right direction. |
Lets provide codemod ( https://github.com/facebook/codemod - or maybe just simple JS script) for developers convenience to migrate from old to new endpoint names. It should speed up adoption, ergo, speed up deprecation date. |
We used database, table, row, column when we build OOC Tools for the module marketplace. While it might not be technically the right name, anyone that can use Excel will understand the terms and in turn how to use our software. codemod would only solve for us about 50% for this level of refactoring. Please roll this out slowly, give a big heads up, keep backward compatibility for time period (if possible and feasible). Don't just say "it's live, let us know if anything breaks", because most of the time it breaks something for us. |
It wont break anything, old endpoints will stay, new will appear. |
@Developer-DNM |
^ better link to show it: https://www.prisma.io/docs/concepts/components/prisma-schema/data-model/ |
First PR was merged - GraphQL Migration hints:
Example before
Example after:
More examples can be found in our open source repositories: |
Migration path for
Example migration commit: |
Just please note that views would need to be updated accordingly, because |
@Slashek I don't think There's also the fact that since a |
@darylbarnes models were good when we had different types of db tables in the system. When that was the case, we needed to name them according to their concept. But the holy grail of simplicity is when you don't need to give something a conceptual name, but can simply call it what it is. @Slashek is right. We no longer have other table concepts, with the exception of the user table. So why not take the win and call it what it is? |
@onecreative simplicity is good. The problem with the original design of the system was that But now that The current proposal for You don't want the back end concepts to spill into the front end unless you do it fully and don't ever want to change your api. As soon as they are out of sync it introduces complexity... you see tables and so you intuitively think a listing on the table is a row but then you get completely side swiped by the fact that it is not a "row" but a "record". No consistency means it's counter-intuitive. You can't have your foot in 2 different concepts. You need to use either tables and rows on the backend or models and records. Choose one or the other. I strongly suggest |
And that's exactly how it should be. Records and models are concepts module builders want on the backend api because it is technically correct. Then we can choose whether or not to expose a more user friendly terminology to our end users by mapping to those names. |
|
Good point, @mattwalter91. The point is moot because they screwed up the naming when they originally did |
True. I don't mind a clean break in this case though because I think it's very important to get this right. I would also like to see the platform end up with a directory structure with models, views, and controllers. We already have views. We now have the opportunity to have models. Tables and model_schemas just don't fit. I say just leave |
I think this is bound to be a losing battle. If there is any single area that requires backwards compatibility, this may be it. I can see some partners leaving over that kind of a break. I can see CBO considering other options over that kind of a break. |
Well you and I talked about the need to fix this way back before people started building a lot of things on it because of how important naming and structure is and how hard it is to change afterwards. There is a reason you fought so hard for It is what it is at this point. As long as there is a plan and a schedule, I would hope any partners would understand the importance of getting the foundations right. The fact that this is the area needing the most backwards compatibility just goes to prove how foundational it is. After all, new partners coming on board will be judging their options as well, new developers will be learning the system, and you don't want this to be a stumbling block. I believe platformOS has a brighter future ahead than where it is now. This might be better discussed in a private slack channel or something. |
I think this is the ideal place to discuss these things. We just need to pick subjects where there is still a chance to make a change. I think this one is as good as closed. |
It's awesome to see all the contributions and discussions - thanks! Since day 1 we were explaining our concepts as "think of Model as DB Record and ModelSchema as DB Table" and it worked quite nicely, that's why we decided to stick with this naming. However, instead of putting tables definitions to Since this issue was created, we have managed to make our community site https://community.platformos.com/ up and running, happy to continue the discussion there! Closing the ticket, we will be updating the documentation now. |
We reached the point when
Model
is flexible enough to replace bothTransactable
(a deprecated long time ago) andUserProfile
. The naming, however, is still confusing for most people, especially with DB background. We would like to fix the naming and use intuitive nouns instead of having to explain it in the documentation.We would like to change
Model Schema
toTable
andModel
toRecord
. This means that for example instead of havingmodel_create
we will have nowrecord_create
, instead ofadmin_model_schemas
we will haveadmin_tables
etc. This should make platformOS more intuitive to use. We would like to keepproperty
as it is, as we didn't hear negative feedback about that one.[UPDATED] - Some links from the comments below to PRs which update old names:
examples - mdyd-dev/platformos-examples#90
template - mdyd-dev/product-marketplace-template#93
The text was updated successfully, but these errors were encountered: