zubairshokh / GamificationEngine

Gamification Engine for Leaderboard/Award Points
0 stars 0 forks source link

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

Open mangalakader opened 6 years ago

mangalakader commented 6 years ago

@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 commented 6 years ago

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