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

For Generating Dynamic Models, we might need Phx.Gen.Model #1

Open
mangalakader opened this issue Feb 20, 2018 · 1 comment
Open

For Generating Dynamic Models, we might need Phx.Gen.Model #1

mangalakader opened this issue Feb 20, 2018 · 1 comment
Assignees

Comments

@mangalakader
Copy link

@zubairshokh I am trying to create a custom mix task for generating activity model from the configuration provided by user for activities, but ecto doesn't have functionality to create model with the help of mix task like phoenix has mix phx.gen.{model}. So, how to proceed? Do we create our own model generator or use phoenix dependency? Give me your suggestion....

@zubairshokh
Copy link
Owner

I created a dummy and tested for various tasks and creation of models, there are many problems that needs to be validated before creating new tasks. However if someone has many activities and for every activity new table will be created, and keeping track of many tables 'activities' will be very complex, as we will have to work with many tables and their many fields rather than working with just one table and their many tables. Also, for every table set to query, we need a separate database trip thus decreases performance. We should rather create a single activity table, and add different fields in the already create schema, rather than creating new schema/migrations/models dynamically. @PMANGALA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants