-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Import LB3 model JSON file to LB4 model class #2480
Comments
@bajtos , currently the lb4 @model(
{
"name": "Product",
"properties": {
"name": {
"type": "string",
"required": true
}
}
})
class Product extends Entity {
} |
How are we going to handle the model-config.json ? |
Is there a migration manual somewhere? I have eight months left to migrate my project from lb3 to lb4 and no idea where to start. |
Alright, thank you. |
In LB3, model setup has two steps:
The goal of this story is to provide LB4 version for the first step only. The second step will be handled by #2036, see also the spike that have already begun: #3617 |
The first draft of the implementation (early WIP): #3688 |
I'll be opening a follow-up story for this point.
We don't have much of migration guide yet, let's make this item a part of #3718.
Let's offer built-in models for the initial version and then use feedback from users to decide what changes (if any) we want to make.
Since we cannot import models inheriting from custom app models yet, I feel selecting all models by default will not work for most developers. I am also not sure how many developers will want to import LB3 built-in models like
Let's wait until there is user demand for this feature.
I'll be opening a follow-up issue for MongoDB. Based on docs in our cloudant connector, |
Created the following follow-up stories:
|
Closing as done! |
As an LB3 user migrating my model definition files to LB4, I would like to call
lb4
CLI to generate an LB4 model class from my LB3 model JSON file.The initial version should handle property definitions only.
For example, let's take an LB3 Product model with a
name
property:This LB3 definition should be translated into an LB4 TypeScript model class:
Acceptance criteria
lb4 model
, or perhaps a new command, accepting a path to LB3 model file, that will scaffold (code-generate) an LB4 model file from LB3 definition. See Model Discovery #2245 for related prior work. (/cc @marvinirwin)--> see CLI: Import LB3 model(s) into LB4 project [EXPERIMENTAL] #3688
Model
->Model
PersistedModel
->Entity
KeyValueModel
-> (to be determined)When the base model class is not recognized, the CLI should abort with a descriptive error.
--> see CLI: Import LB3 model(s) into LB4 project [EXPERIMENTAL] #3688
relations
method
mixins
acls
--> see CLI: Import LB3 model(s) into LB4 project [EXPERIMENTAL] #3688
options
property, we need to support both flavors. Notable settings to test & support:forceId
strict
--> see CLI: Import LB3 model(s) into LB4 project [EXPERIMENTAL] #3688
--> see CLI: Import LB3 model(s) into LB4 project [EXPERIMENTAL] #3688
base
model classes and relations.See #2036 for the next step that will allow developers to take LB4 model and expose it via REST with little to no configuration.
Open discussion points & todos
User
andAccessToken
for importing?--models User,AccessToken
? Use positional arguments likelb4 import-model my-lb3-app User AccessToken
?_rev
property handled?)Out of scope
The text was updated successfully, but these errors were encountered: