Getting SQL from Doctrine Migration

I am exploring a way to retrieve SQL statements that are generated by a generated migration file. They extend Doctrine_Migration_Base. Essentially, I would like to save SQL as change scripts.

The execution path leads me to Doctrine_Export, which has methods that build the SQL statement and execute them. I did not find a way to ask for them. The export methods found in Doctrine_Export only work with Doctrine_Record models, not migration scripts.

From the command line './doctrine migrate version #' goes the way:

  • Doctrine_Cli :: Run (CMD)
  • Doctrine_Task_Migrate :: setArguments (arg)
  • Doctrine_Task_Migrate :: Execute ()
  • Doctrine_Migration :: migrates (to)
  • Doctrine_Migration_Process :: Doctrine_Export :: various create, delete, modify methods using sql equivalents.

Has anyone done this before? I really would not want to change the base Doctrine files. Any help is appreciated.

+5
source share
2 answers

Given Rob Farley's suggestion, I changed:

  • Doctrine_Core :: Migrates
  • Doctrine_Task_Migrate :: Execute

execute, "dryRun" . "Doctrine_Connection_Profiler". "dryRun" Doctrine_Core:: migrate. "dryRun" true SQL. , SQL "migration_version", .

0

dev- , SQL-, ? , .

0

All Articles