• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic Database Migrations - Proposal

#1
Hello community, 
i had a few projects in Python/DJANGO and have seen some really useful stuff but one especially helpful

Database migrations generated automatically from the Models

i love CI and want to have all the good stuff in here as well to speed up development times

Benefits:

- table field definitions are in a single place (single source of truth) in the Model
- migration files are temporary
- you can delete all dev incremental migrations and recreate a final migration

i understand that this is a braking change for the CI updates but that's why i ask your opinions on this.

Implementation:
we already have the $allowedFields property defining the field names

i propose new property called $fields or similar describing the fields like in the migrations currently, this also needs clarification.

What are your thoughts ?
Reply

#2
I have a module that plans to include this:

https://GitHub.com/tattersoftware/codeigniter4-schemas

The Publisher handlers aren’t written yet but the Model Drafter is there. I have to peel for another project but hopefully will be looking at Publisher soon.
Reply

#3
Thanks @MGatner but from what i saw your library is doing schema generation from existing Database.
what i would like to have or make is

Model ----> migrations ----> database <---- Seeds (fixtures)


so that the schema definition is in one place and thats the Model

whats your recommendation for this, i understand that you have lots of experience on this already and i don't want to reinvent the wheel.
Reply

#4
Yep. I understood, and it is planned but not coded yet.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.