I'm having a problem with my micro application, I use PostgreSQL as database, but the database adapter I create don't set the schema for the models and I need to do it manually using the models manager, how can I avoid setting the schema manually for every model?
This is how I'm creating the Adapter
use Phalcon\Db\Adapter\Pdo\Postgresql as DbAdapter; ... return new DbAdapter(array( "host" => $config->database->host, "username" => $config->database->username, "password" => $config->database->password, "dbname" => $config->database->dbname, "schema" => $config->database->schema, ));
This doesn't work
$person = new Person; $person = $person->findFirst(1);
$person = new Person; $app->modelsManager->setModelSchema($person, 'myschema'); $person = $person->findFirst(1);
If I don't set the schema manually then the model object can't find the tables:
Table "person" doesn't exist on database when dumping meta-data for Person.
I think the script is always reading the public schema instead of the one I set up.