| [SOLVED]adding a table to existing project [message #21449] |
Mon, 12 February 2007 16:15  |
Segolas Messages: 83 Registered: April 2006 |
Member |
|
|
Hello,
I need to add a table to an existing project.
Can I simply *add* (so other tables are keeped in the file) the table specs to schema.yml ad re-run "symfony propel-build-model"?
Or do I have to *delete* previous tables from schema.yml, write the new none (so the schema contains just the new table), and re-build the model?
[Updated on: Mon, 12 February 2007 19:06]
|
|
|
| Re: adding a table to existing project [message #21451 is a reply to message #21449 ] |
Mon, 12 February 2007 17:07   |
pezetgee Messages: 734 Registered: March 2006 |
Faithful Member |
|
|
Both approaches will work.
Personally I use the first one - add new table definition.
After running propel-build-model, run propel-build-sql and symfony will create relevant "create table" sql commands for you.
|
|
|
|
| Re: adding a table to existing project [message #21456 is a reply to message #21452 ] |
Mon, 12 February 2007 17:26   |
pezetgee Messages: 734 Registered: March 2006 |
Faithful Member |
|
|
Yes, that's pretty much the way.
If your existing tables are empty you could run propel-build-all which will rebuild the model and insert all tables. This however will drop all the existing tables first.
Another way, good if you're adding more tables, is to backup your existing data, run propel-build-all and then restore the data.
[Updated on: Mon, 12 February 2007 17:27]
|
|
|
|
|
|
|
| Re: adding a table to existing project [message #22544 is a reply to message #21508 ] |
Mon, 26 February 2007 23:29   |
slarmore Messages: 31 Registered: January 2007 |
Member |
|
|
Same problem here.
------------------------------
Steve Larmore
slarmore aht chfund doht org
|
|
|
| Re: adding a table to existing project [message #23263 is a reply to message #22544 ] |
Wed, 07 March 2007 19:17   |
slarmore Messages: 31 Registered: January 2007 |
Member |
|
|
In the error:
[PropelException]
No sconnection params set for propel
The "propel" is the connection name. For some reason it looks for "propel" db connection instead of the "reporting" db connection. To remedy this, my databases.yml now has a propel database connection:
all:
reporting:
class: sfPropelDatabase
param:
dsn: pgsql://postgres@localhost/reporting
propel:
class: sfPropelDatabase
param:
dsn: pgsql://postgres@localhost/reporting
I'm sure I'm missing something else where I can change the database propel uses to dump data, but so far I have not found it.
Peace,
Steve
------------------------------
Steve Larmore
slarmore aht chfund doht org
|
|
|
| Re: adding a table to existing project [message #23264 is a reply to message #23263 ] |
Wed, 07 March 2007 19:17  |
slarmore Messages: 31 Registered: January 2007 |
Member |
|
|
|
But oddly enough, it doesn't seem to work on my production server ::sigh::
[Updated on: Wed, 07 March 2007 20:23] ------------------------------
Steve Larmore
slarmore aht chfund doht org
|
|
|