0

I have been trying to create schema.yml content in memory from a behavior I have written. I want to test if any changes made by a developer to schema.yml comply with the current database fields and foreign key references. I see the task class that builds schema, but havenot been able to find straightforward way to do that or am I missing something here? Can this be done by leveraging the symfony api already available rather than writing my own solution?

Thanks in advance.

P.S. I am using Propel as ORM

Nitesh
  • 702
  • 2
  • 7
  • 22

1 Answers1

0

Why don't you tweak the migration task to define difference between your current schema (in memory) and the one potentially modified by the developer?

php symfony doctrine:generate-migrations-diff

This task generate a diff between generated classes and current schema.yml.

What you can do:

  • generate new model (form and filter) based on the new schema.yml
  • put this change into a new folder (not defaults one)
  • run the task doctrine:generate-migrations-diff an give it the path for new models (forms and filters)
  • if it generates migrations classes: developper made some change, if not, every thing is ok.

Edit: (since the OP use propel)

You have almost the same task in Propel (and the doc).

j0k
  • 22,600
  • 28
  • 79
  • 90