propelorm/PropelBundle — Issue #62: problem with insert-sql (and generic database connection)
Author: stormsson
Created: 2011-10-17 11:47:19+00:00
State: open

i was following the guide linked at:
http://www.propelorm.org/cookbook/symfony2/symfony2-and-propel-in-real-life.html

when i arrive in the insert-sql step, there seems problem:

the tables are NOT written in the database.
my database is called "test", and reading the sources, i found that it
NEVER reach the part of the sql file reading, because of a control a
step before:

in the PropelsqlManager , at the InsertSql method:
inside that, there is a foreach .
in my situation it quits the foreach before reading the sql file,
because the condition
if (null !== $datasource && $database !== $datasource) {
// skip
break;
}
results true, because my database is 'test' , and the datasource is
'default' so it breaks the foreach.

the connection works if from the configuration i create different data sources with something similar to this:

propel:
connections:
default:
driver: %database_driver%
user: %database_user%
password: %database_password%
dsn: %database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%
test: # <- this is the database name
driver: %database_driver%
user: %database_user%
password: %database_password%
dsn: %database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%