| [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation? [message #21387] |
Sat, 10 February 2007 23:54  |
qube Messages: 88 Registered: August 2006 Location: Czech republic |
Member |
|
|
Hi,
I experienced following problem after installing sfGuardPlugin
...
[propel-om] Processing: generated-schema.xml
[propel-om] Processing: generated-sfGuardPlugin-schema.xml
Execution of target "om-template" failed for the following reason:
C:\php51\PEAR\symfony\vendor\propel-generator\build-propel.xml:436:1: Duplicate table found: propel.
update: This problem is caused by building your schema from database (propel-build-schema) command after sfGuardPlugin installation. Propel-build-schema command generates schema.yml with sfGuard tables and therefor tables are defined twice. Once in /config/schema.yml and once in /plugins/sfGuardPlugin/config/schema.yml.
If you need to use propel-build-schema, you can try following solutions (none is perfect):
1) Most clean solution would be, to delete table definitions from generated schema.yml after running propel-build-schema. But this is not very convenient.
2) Edit propel.ini and set
propel.packageObjectModel = false
I don't know what exactly this switch do, but it solves many problems, when I look around the forum.
(found here: http://www.symfony-project.com/forum/index.php/m/21319/?srch =propel.packageObjectModel#msg_21319).
3) Rename database name in one of the schemas:
<database name="propel2" defaultIdMethod="native" package="plugins.sfGuardPlugin.lib.model">
If you do this, you must update database.yml and set connection parameters for your second database name. Maybe there are other consequences I'm not aware of.
This works regardless on settings of propel.packageObjectModel in propel.ini.
4) Delete /plugins/sfGuardPlugin/config/schema.yml, /plugins/sfGuardPlugin/config/schema.xml. By doing this, there is only one definition of tables and thus no problem for Propel.
(as advised by blizzard-media here: http://www.symfony-project.com/forum/index.php/t/4205/)
All these solutions (except 1)) have disadvantage, that sfGuard classes are generated into your /lib/model directory. But despite of this, model classes from /plugins/sfGuardPlugin/lib/model are used anyway.
Note: When experimenting with various settings, clear you cache and cookies, otherwise you can get following error:
Fatal error: Cannot redeclare class sfguardusermapbuilder in ...\plugins\sfGuardPlugin\lib\model\map\sfGuardUserMapBuilder.php on line 5
Is there some correct solution how to use propel-build-schema wit installed plugin, which has own db tables?
[Updated on: Sun, 11 February 2007 16:12]
|
|
|
 |
[sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: qube on Sat, 10 February 2007 23:54 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: francois on Mon, 12 February 2007 09:54 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: qube on Mon, 12 February 2007 11:01 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: Junni on Mon, 16 April 2007 09:22 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
|
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: qube on Mon, 21 May 2007 00:28 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
|
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
|
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: qube on Tue, 22 May 2007 23:50 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
|
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: qube on Wed, 23 May 2007 18:32 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
|
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: bstoppel on Wed, 26 March 2008 19:56 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: oloynet on Wed, 09 April 2008 19:49 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: naholyr on Wed, 16 April 2008 22:33 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
|
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: searaig on Fri, 17 October 2008 02:43 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: ventzy on Sun, 03 May 2009 12:48 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: searaig on Mon, 04 May 2009 19:08 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: ventzy on Tue, 05 May 2009 01:09 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: searaig on Thu, 07 May 2009 08:26 |
 |
Re: [sfGuard] how to correctly use propel-build-schema after sfGuardPlugin installation?
By: searaig on Thu, 14 May 2009 22:47 |