This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » General plug-ins » new plugin sfPropelSqlDiffPlugin - build diff sql
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #60527 is a reply to message #43210 ] Tue, 09 September 2008 16:05 Go to previous messageGo to next message
toubsen  is currently offline toubsen
Messages: 4
Registered: March 2008
Junior Member
Here's a quick fix for the "collate xyz" bug with mysql:

dbInfo.php -> line 61:
// OLD:
// $code = $matches[2];

//NEW:
$code = preg_replace('/collate [\w_]+/', '', $matches[2]);
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #61785 is a reply to message #43210 ] Thu, 25 September 2008 00:42 Go to previous messageGo to next message
mikecrowe  is currently offline mikecrowe
Messages: 27
Registered: August 2006
Junior Member
Update: Needs a little more work -- will provide shortly.

For those using SF 1.1 and Propel 1.3, the attached diff allows you to support multiple schema's with multiple databases (I hope). Works for me.

[Updated on: Thu, 25 September 2008 00:48]


Cheers!
Mike

From despair.com:
INSPIRATION: Genius is 1% inspiration and 99% perspiration...
which explains why engineers smell so bad...
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #67632 is a reply to message #43210 ] Sat, 13 December 2008 09:35 Go to previous messageGo to next message
volod  is currently offline volod
Messages: 85
Registered: June 2008
Member
Hello,

plugin is not available at http://svn.symfony-project.com/plugins/sfPropelSqlDiffPlugin
was it moved somewhere?

Thanks!


Vladimir Bilyov Websites development and support, Design, SEO
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #69125 is a reply to message #43210 ] Sat, 03 January 2009 14:55 Go to previous messageGo to next message
gray  is currently offline gray
Messages: 30
Registered: January 2008
Member
Version for symfony 1.2 is available now, thanks to Vladimir Bilyov.

Quote:

plugin is not available at http://svn.symfony-project.com/plugins/sfPropelSqlDiffPlugin
was it moved somewhere?


Now it is available here.
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #69127 is a reply to message #69125 ] Sat, 03 January 2009 15:39 Go to previous messageGo to next message
volod  is currently offline volod
Messages: 85
Registered: June 2008
Member
gray wrote on Sat, 03 January 2009 15:55

Version for symfony 1.2 is available now, thanks to Vladimir Bilyov.



Gray, thank you for your work Smile


Vladimir Bilyov Websites development and support, Design, SEO
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #76949 is a reply to message #43210 ] Thu, 16 April 2009 15:10 Go to previous messageGo to next message
gray  is currently offline gray
Messages: 30
Registered: January 2008
Member
new release available - 0.2.0

Changelog:
* multiple databases support
* don't create foreign keys on myisam and ndbcluster tables
* task propel:build-all-diff now runs also propel:build-filters and propel:build-forms
* ignore views when building database patch
* license change: MIT -> LGPL
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #78190 is a reply to message #43210 ] Tue, 12 May 2009 15:51 Go to previous messageGo to next message
raj1965  is currently offline raj1965
Messages: 25
Registered: April 2009
Junior Member
hi,

i want to be able to check out the trunk of my project, work on it, edit the schema, etc, and then have a way of recording changes made to the database before I commit.

Has anyone any idea how i could do this? This plugin is almost what I want, but in reverse, i.e. i want to be able to take an old schema file and look at a database, and get some sql that would bring a database using the old schema up-to-date with the new db.

thanks,
raj
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #78191 is a reply to message #78190 ] Tue, 12 May 2009 15:55 Go to previous messageGo to next message
florynth  is currently offline florynth
Messages: 185
Registered: January 2007
Location: Québec - Montréal
Senior Member
You just have to run the

symfony propel-build-sql-diff [application_name]

And it will generate a diff.slq file that you'll copy and commit it somewhere


The best way to improve your Symfony knowledge is to read the source code !
When you start a project two main issues : database and security.
Sorry for my english, my first language is french.
Working for : http://www.tribalnova.com
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #78194 is a reply to message #78191 ] Tue, 12 May 2009 17:20 Go to previous messageGo to next message
raj1965  is currently offline raj1965
Messages: 25
Registered: April 2009
Junior Member
oh yeah. thanks.
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #78200 is a reply to message #78190 ] Tue, 12 May 2009 17:58 Go to previous messageGo to next message
gray  is currently offline gray
Messages: 30
Registered: January 2008
Member
take a look at built-in task propel:build-schema
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #82037 is a reply to message #43210 ] Fri, 17 July 2009 11:03 Go to previous messageGo to next message
cancausecancer  is currently offline cancausecancer
Messages: 9
Registered: January 2009
Location: The marble
Junior Member
I modified the plugin to add foreign key checking for columns which already exist in the db and have mismatched column types which keep foreign keys from being built or keeps column types from being changed.

If the column types are different for the fkey'd column and foreign table's column, it fixes it by dropping the fkey, changing the fkey column type to match the foreign table's type and then adding the fkey back.

Don't use this version unless you are having problems being unable to make foreign keys or being unable to change column types because the tables have foreign keys already and their types don't match.

I've ran it on my db more than 50 times and it works for my db with 100s of tables. It's use at your own risk and make sure to back up any vital data and your old version of the plugin too just for safety.


I have to code in other langs besides what I use at work because work is lowering my iq.
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #84268 is a reply to message #43210 ] Mon, 24 August 2009 15:36 Go to previous messageGo to next message
omansour  is currently offline omansour
Messages: 3
Registered: August 2006
Junior Member
Hey

Using your plugin in our big symfony project I found some bugs on default value and null detection.
Here the patch I have created for the 1.2 version.

best regards
Olivier

Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #84566 is a reply to message #43210 ] Sun, 30 August 2009 00:09 Go to previous messageGo to next message
vojta.jina  is currently offline vojta.jina
Messages: 55
Registered: November 2008
Location: Czech Republic
Member
When I run the propel:build-sql-diff, it creates whole schema...
The problem is, that it does not load anything from db.

When I try to execute some basics Propel commands inside sfPropelBuildSqlDiffTask->execute(), like:
MyClassPeer::doSelect(new Criteria()), its working...

But dbInfo->loadFromDb() returns false...
Do you have any ideas, what could be the problem ?

Thanks a lot.
V.
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #84742 is a reply to message #84566 ] Wed, 02 September 2009 22:10 Go to previous messageGo to next message
cancausecancer  is currently offline cancausecancer
Messages: 9
Registered: January 2009
Location: The marble
Junior Member
>When I run the propel:build-sql-diff, it creates whole schema...
>The problem is, that it does not load anything from db.

Do the tables exist in the DB? Is it looking at the correct DB name?

You may have to execute the sql diff file so it creates the DB in MySQL. I believe propel:insert-sql-diff will do that. You would have to run it after you build-diff. If that is what you need, you can also go to the /data/sql/ folder and find the diff.sql (or propel.diff.sql in the new version) and execute that on the server. That sql file is the resulting sql from the sql-diff.


I have to code in other langs besides what I use at work because work is lowering my iq.
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #84793 is a reply to message #84742 ] Thu, 03 September 2009 16:47 Go to previous messageGo to next message
vojta.jina  is currently offline vojta.jina
Messages: 55
Registered: November 2008
Location: Czech Republic
Member
Here is the begining of the execute() code:
    $databaseManager = new sfDatabaseManager($this->configuration);
    $connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
        
    $buildSql = new sfPropelBuildSqlTask($this->dispatcher, $this->formatter);
    $buildSql->setCommandApplication($this->commandApplication);
    $buildSql->run();

    $this->logSection("sql-diff", "building database patch");
    
    $i = new dbInfo();
    $i->loadFromDb(Propel::getConnection($options['connection']));


$buildSql->run() works fine. It creates SQL of the schema.yml.

$databaseManager is connected right, because when I try something like this, it works:
$items = SomePeer::doSelect(new Criteria());


The problem is, that dbInfo ($i) does load nothing !
When I send the $connection, still nothing:
$i->loadFromDb($connection);


On my local machine (Win XP, MySQL: 5.0.77-community-nt) everything works fine.
But on a server (Debian/GNU Linux, MySQL: 5.0.32-Debian_7etch5-log)
Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #90248 is a reply to message #84793 ] Sat, 19 December 2009 23:03 Go to previous messageGo to next message
Vengeance  is currently offline Vengeance
Messages: 8
Registered: May 2007
Location: Lodz, Poland
Junior Member
vojta.jina I have the same problem.

I checked that "if($stmt->rowCount()==0) return false;" in dbInfo.php:13 always returns FALSE even though the query is performed well. When this comment out, the script works

Re: new plugin sfPropelSqlDiffPlugin - build diff sql [message #91679 is a reply to message #43210 ] Mon, 18 January 2010 15:41 Go to previous message
JackJones  is currently offline JackJones
Messages: 67
Registered: February 2007
Member
Hi All

Seems to be a very nice plugin.
I have some problem's with the installation, what is the best whay to install it ?

Thx
Previous Topic:sfDoctrineGuardUser - newbee question
Next Topic:generate doctrine admin to a plugin directory
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software