diff --git a/lib/Doctrine/Facade.php b/lib/Doctrine/Facade.php index 34a626a55..c95be73c7 100644 --- a/lib/Doctrine/Facade.php +++ b/lib/Doctrine/Facade.php @@ -169,7 +169,7 @@ class Doctrine_Facade { $directory = '/tmp/tmp_doctrine_models'; - Doctrine::generateModelsFromDb($directory); + Doctrine_Facade::generateModelsFromDb($directory); $export = new Doctrine_Export_Schema(); @@ -321,7 +321,7 @@ class Doctrine_Facade if ($delete) { - $models = Doctrine::getLoadedModels(); + $models = Doctrine_Facade::getLoadedModels(); foreach ($models as $model) { @@ -351,7 +351,7 @@ class Doctrine_Facade if ($delete) { - $models = Doctrine::getLoadedModels(); + $models = Doctrine_Facade::getLoadedModels(); foreach ($models as $model) { diff --git a/sandbox/config.php.dist b/sandbox/config.php.dist index beabb2f51..730c31381 100644 --- a/sandbox/config.php.dist +++ b/sandbox/config.php.dist @@ -38,13 +38,15 @@ define('SANDBOX_PATH', dirname(__FILE__)); define('DOCTRINE_PATH', dirname(SANDBOX_PATH) . DIRECTORY_SEPARATOR . 'lib'); define('DATA_FIXTURES_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'fixtures'); define('MODELS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models'); -define('MIGRATIONS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models'); +define('MIGRATIONS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'migrations'); define('SQL_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'sql'); define('YAML_SCHEMA_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'schema'); -define('DSN', 'sqlite:/' . SANDBOX_PATH . DIRECTORY_SEPARATOR . 'sandbox.db'); +define('DB_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'sandbox.db'); +define('DSN', 'sqlite:' . DB_PATH); require_once(DOCTRINE_PATH . DIRECTORY_SEPARATOR . 'Doctrine.php'); spl_autoload_register(array('Doctrine', 'autoload')); -Doctrine_Manager::connection(DSN, 'sandbox'); \ No newline at end of file +$pdo = new PDO(DSN); +Doctrine_Manager::connection($pdo, 'sandbox'); \ No newline at end of file diff --git a/sandbox/models/generated/BaseUser.class.php b/sandbox/models/generated/BaseUser.class.php index eba00611d..a2a74df32 100644 --- a/sandbox/models/generated/BaseUser.class.php +++ b/sandbox/models/generated/BaseUser.class.php @@ -10,7 +10,7 @@ abstract class BaseUser extends Doctrine_Record { $this->setTableName('user'); $this->hasColumn('username', 'string', 255); - $this->hasColumn('contact_id', 'integer', null); + $this->hasColumn('contact_id', 'integer', 11); } public function setUp() diff --git a/sandbox/sandbox.db b/sandbox/sandbox.db index 5f4bd6848..6f0820dba 100755 Binary files a/sandbox/sandbox.db and b/sandbox/sandbox.db differ diff --git a/sandbox/schema/user.yml b/sandbox/schema/user.yml index 10cfa2b67..895596450 100644 --- a/sandbox/schema/user.yml +++ b/sandbox/schema/user.yml @@ -6,7 +6,7 @@ User: length: 255 contact_id: type: integer - size: 11 + length: 11 relations: Contact: local: contact_id