modules.zendframework.com
modules.zendframework.com copied to clipboard
[WIP] Feature/doctrine
This PR is adding Doctrine ORM to the Project and will replace the Zend\Db Mappers. Follows after Discussion in #496
- [x] added doctrine
- [x] added module entity
- [ ] added user entity
- [x] changed application module
- [ ] changed user module
- [ ] changed zfmodule module
- [ ] remove old mapper
- [ ] edit existing tests
@localheinz @gianarb @Ocramius @GeeH
@ins0
What do you think, can I help with a PR that prepares for this and adds the capability to run Doctrine migrations?
@localheinz
What do you think, can I help with a PR that prepares for this and adds the capability to run Doctrine migrations?
Yes please! I'm not very familiar with Doctrine Migrations nor how to setup this feature
@ins0
Doctrine migrations are implemented in #502.
About this PR, what do you think about breaking it up into smaller parts? Since we agreed that we want to use Doctrine, it doesn't need to be implemented all in one PR.
Maybe start with creating entities and making sure we've got the schema right? Then, in a next step, start using them.
We should be running
$ php public/index.php orm:info
$ php public/index.php orm:validate-schema
as part of the script
on Travis, and just make sure for a start that the mappings are right.
What do you think?
@localheinz sound good to me. what do u suggest, changing the current db structure - creating doctrine entitys or vice versa?
This is the first time i meet doctrine migrations (oh boy - don't let @Ocramius hear that :smile_cat: ) so currently i don't know for sure what had changed, if someone can give me a short hint with this that would be nice.
/cc @gianarb
IMO we can use doctrine\migrations to change the current database schema. After this process we can write a correct entities.. :)
A migration is very easy to implement. http://docs.doctrine-project.org/projects/doctrine-migrations/en/latest/reference/migration_classes.html.
We can write a SQL script to update our struct.. And another SQL script to down it in the old version
@ins0
Depends entirely on which way you want to go - do you have a preference?
By the way, zendframework/modules.zendframework.com:1.6.0
has been deployed - with a little downtime, as I forgot to edit the local configuration files before deploying, but, it's up!
@ins0
Following the merge of #502, you need to rebase, sorry!
@ins0
In regard to the migrations, as @gianarb suggested, you can start by creating migrations as suggested:
$ php public/index.php migrations:generate
This will create a migration class, which you can modify to your needs.
If you have a migration which you can't or don't ever want to be able to roll back, you should probably throw a Doctrine\DBAL\Migrations\IrreversibleMigrationException
.
thanks @gianarb @localheinz , so i think i will stop here and handle the remaining todos (described above) in different prs as this is more clear, do u agree? the proposed db change #496 don't affect this improvement nor needs db changes so i think migration changes will not occur in this and the following prs
Yes.. It sounds good :)
More easy to merge and to follow :)
2015-10-19 11:11 GMT+02:00 Marco Rieger [email protected]:
thanks @gianarb https://github.com/gianarb @localheinz https://github.com/localheinz , so i think i will stop here and handle the remaining todos (described above) in different prs as this is more clear, do u agree?
— Reply to this email directly or view it on GitHub https://github.com/zendframework/modules.zendframework.com/pull/497#issuecomment-149153460 .
Gianluca Arbezzano www.gianarb.it