suramon/sf-propel-sql-diff-plugin

Generate diff.sql file, which contains difference between schema.yml and current database structure

0.4.1 2017-05-17 19:48 UTC

This package is not auto-updated.

Last update: 2024-11-09 18:37:59 UTC


README

= sfPropelSqlDiffPlugin =
[[PageOutline]]

sfPropelSqlDiff plugin generates database sql patch, which contains difference beetween schema.yml and current database structure.

== Description ==
It provides new symfony task - propel:build-sql-diff which will create file propel.diff.sql with ALTER TABLE statements, whitch will make current database structure 
exactly as it described in schema.yml without deleting data in tables as it does propel:build-sql task.

Currently it handles:
 - creation and deletion of tables/fields/indexes/foreign keys
 - changing fields/indexes/foreign keys

Plugin is in beta state now. It is tested only for mysql. You can discuss it at [http://www.symfony-project.org/forum/index.php/t/10679/ thread in symfony forum]

== Usage ==

After making changes in schema.yml
  {{{
  php symfony propel:build-sql-diff
  }}}

Then you can find sql file at data/sql/propel.diff.sql

To execute propel.diff.sql
  {{{
  php symfony propel:insert-sql-diff
  }}}
  
To run model rebuild and apply database changes to database 
  {{{
  php symfony propel:build-all-diff
  }}}

You can also specify connection name if you have more than one database, application name, environment. For more info please take a look at
  {{{
  php symfony help propel:build-sql-diff
  }}}