| | 485 | } |
|---|
| | 486 | |
|---|
| | 487 | /** |
|---|
| | 488 | * run_doctrine_generate_migrations_from_models |
|---|
| | 489 | * |
|---|
| | 490 | * @param string $task |
|---|
| | 491 | * @param string $args |
|---|
| | 492 | * @return void |
|---|
| | 493 | */ |
|---|
| | 494 | function run_doctrine_generate_migrations_from_models($task, $args) |
|---|
| | 495 | { |
|---|
| | 496 | _bootstrap_symfony(); |
|---|
| | 497 | |
|---|
| | 498 | $migrationsDirectory = sfConfig::get('sf_root_dir'). DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'migration' . DIRECTORY_SEPARATOR . 'doctrine'; |
|---|
| | 499 | |
|---|
| | 500 | $modelsDirectory = sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'doctrine'; |
|---|
| | 501 | |
|---|
| | 502 | pake_mkdirs($migrationsDirectory); |
|---|
| | 503 | |
|---|
| | 504 | pake_echo_action('doctrine', sprintf('generate migration classes from models to: %s', $migrationsDirectory)); |
|---|
| | 505 | |
|---|
| | 506 | Doctrine::generateMigrationsFromModels($migrationsDirectory, $modelsDirectory); |
|---|
| | 507 | } |
|---|
| | 508 | |
|---|
| | 509 | /** |
|---|
| | 510 | * run_doctrine_generate_migrations_from_db |
|---|
| | 511 | * |
|---|
| | 512 | * @param string $task |
|---|
| | 513 | * @param string $args |
|---|
| | 514 | * @return void |
|---|
| | 515 | */ |
|---|
| | 516 | function run_doctrine_generate_migrations_from_db($task, $args) |
|---|
| | 517 | { |
|---|
| | 518 | _bootstrap_symfony(); |
|---|
| | 519 | |
|---|
| | 520 | $migrationsDirectory = sfConfig::get('sf_root_dir'). DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'migration' . DIRECTORY_SEPARATOR . 'doctrine'; |
|---|
| | 521 | |
|---|
| | 522 | $modelsDirectory = sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'doctrine'; |
|---|
| | 523 | |
|---|
| | 524 | pake_mkdirs($migrationsDirectory); |
|---|
| | 525 | |
|---|
| | 526 | pake_echo_action('doctrine', sprintf('generate migration classes from databases to: %s', $migrationsDirectory)); |
|---|
| | 527 | |
|---|
| | 528 | Doctrine::generateMigrationsFromDb($migrationsDirectory); |
|---|