sfPropelSqlDiffPlugin - 0.2.0

generate diff.sql file, which contains difference beetween schema.yml and current database structure

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

sfPropelSqlDiffPlugin

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 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