[Work in progress] Refactoring of all database stuff#49
[Work in progress] Refactoring of all database stuff#49mpscholten wants to merge 7 commits intodeleteman:masterfrom
Conversation
…ing fields to some models
|
Hey @mpscholten , awesome job man! This is looking promising! Thanks so much for taking care of this! Also, how is this new propel based persistence layer going to handle the migrations? I'm really exited about this, thanks again! |
|
Awesome to hear you like it. Currently only supports database schemas defined in the xml format. I'm also a big fan of yaml, but in this case I'd just stay with xml to keep it simple. Otherwise the other configuration files of propel can all be defined in yaml. Migrations are very easy with propel. Basically you just call |
While hacking on a pdo replacement for the current implementation of our orm I got the feeling that I was reinventing the wheel :) Therefore I stopped working on building our "custom orm thing" and replaced it with propel 2.
Basically propel generates all the "basic" model code for us (stored in
app/models/Baseandapp/models/Map). The generated code should not be stored in our repo, you have to generated it by runningvendor/bin/propel build --input-dir=config -vvv. Propel uses aschema.xmlfor defining the database schema, which is used for the code generation. With this approach I could rebuild the models with propel very easy (and in nearly no time, I just had to write a few lines in theschema.xml).I just need to update the controllers and this should be ready.
At this point I want to get some feedback before I will continue working on this.
@deleteman: Please look over the code and let me know if you are happy with my choice or if we should rethink :)