public static function setUpBeforeClass() { self::$dbm = \TestHelperMw::getDBManager(); if (!self::$dbm instanceof \Aimeos\MW\DB\Manager\DBAL) { return; } $schema = new \Doctrine\DBAL\Schema\Schema(); $cacheTable = $schema->createTable('mw_cache_test'); $cacheTable->addColumn('id', 'string', array('length' => 255)); $cacheTable->addColumn('siteid', 'integer', array('notnull' => false)); $cacheTable->addColumn('expire', 'datetime', array('notnull' => false)); $cacheTable->addColumn('value', 'text', array('length' => 0xffff)); $cacheTable->addUniqueIndex(array('id', 'siteid')); $cacheTable->addIndex(array('expire')); $tagTable = $schema->createTable('mw_cache_tag_test'); $tagTable->addColumn('tid', 'string', array('length' => 255)); $tagTable->addColumn('tsiteid', 'integer', array('notnull' => false)); $tagTable->addColumn('tname', 'string', array('length' => 255)); $tagTable->addUniqueIndex(array('tid', 'tsiteid', 'tname')); $tagTable->addForeignKeyConstraint('mw_cache_test', array('tid', 'tsiteid'), array('id', 'siteid'), array('onDelete' => 'CASCADE')); $conn = self::$dbm->acquire(); foreach ($schema->toSQL($conn->getRawObject()->getDatabasePlatform()) as $sql) { $conn->create($sql)->execute()->finish(); } self::$dbm->release($conn); }
protected function setUp() { $schema = new \Doctrine\DBAL\Schema\Schema(); $table = $schema->createTable('mw_unit_test'); $table->addColumn('id', 'integer', array('autoincrement' => true)); $table->addColumn('name', 'string', array('length' => 20)); $table->setPrimaryKey(array('id')); $this->config = \TestHelperMw::getConfig(); $this->object = new \Aimeos\MW\DB\Manager\DBAL($this->config); $conn = $this->object->acquire(); foreach ($schema->toSQL($conn->getRawObject()->getDatabasePlatform()) as $sql) { $conn->create($sql)->execute()->finish(); } $this->object->release($conn); }
public static function setUpBeforeClass() { self::$dbm = \TestHelperMw::getDBManager(); if (!self::$dbm instanceof \Aimeos\MW\DB\Manager\DBAL) { return; } $schema = new \Doctrine\DBAL\Schema\Schema(); $table = $schema->createTable('mw_log_test'); $table->addColumn('facility', 'string', array('length' => 32)); $table->addColumn('request', 'string', array('length' => 32)); $table->addColumn('tstamp', 'string', array('length' => 20)); $table->addColumn('priority', 'integer', array()); $table->addColumn('message', 'text', array('length' => 0xffff)); $conn = self::$dbm->acquire(); foreach ($schema->toSQL($conn->getRawObject()->getDatabasePlatform()) as $sql) { $conn->create($sql)->execute()->finish(); } self::$dbm->release($conn); }
public static function setUpBeforeClass() { self::$dbm = \TestHelperMw::getDBManager(); if (!self::$dbm instanceof \Aimeos\MW\DB\Manager\DBAL) { return; } $schema = new \Doctrine\DBAL\Schema\Schema(); $table = $schema->createTable('mw_mqueue_test'); $table->addColumn('id', 'integer', array('autoincrement' => true)); $table->addColumn('queue', 'string', array('length' => 255)); $table->addColumn('cname', 'string', array('length' => 32)); $table->addColumn('rtime', 'datetime', array()); $table->addColumn('message', 'text', array('length' => 0xffff)); $table->setPrimaryKey(array('id')); $conn = self::$dbm->acquire(); foreach ($schema->toSQL($conn->getRawObject()->getDatabasePlatform()) as $sql) { $conn->create($sql)->execute()->finish(); } self::$dbm->release($conn); }
public static function setUpBeforeClass() { self::$dbm = \TestHelperMw::getDBManager(); if (!self::$dbm instanceof \Aimeos\MW\DB\Manager\DBAL) { return; } $schema = new \Doctrine\DBAL\Schema\Schema(); $table = $schema->createTable('mw_tree_test'); $table->addColumn('id', 'integer', array('autoincrement' => true)); $table->addColumn('parentid', 'integer', array('notnull' => false)); $table->addColumn('label', 'string', array('length' => 16)); $table->addColumn('code', 'string', array('length' => 32)); $table->addColumn('level', 'integer', array()); $table->addColumn('nleft', 'integer', array()); $table->addColumn('nright', 'integer', array()); $table->addColumn('status', 'smallint', array()); $table->setPrimaryKey(array('id')); $conn = self::$dbm->acquire(); foreach ($schema->toSQL($conn->getRawObject()->getDatabasePlatform()) as $sql) { $conn->create($sql)->execute()->finish(); } self::$dbm->release($conn); }