for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @file
*/
namespace CultuurNet\UDB3\ReadModel\Index\Doctrine;
use CultuurNet\UDB3\Doctrine\DBAL\SchemaConfiguratorInterface;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use ValueObjects\StringLiteral\StringLiteral;
class SchemaConfigurator implements SchemaConfiguratorInterface
{
* @var StringLiteral
protected $tableName;
* @param StringLiteral $tableName
public function __construct(StringLiteral $tableName)
$this->tableName = $tableName;
}
* @inheritdoc
public function configure(AbstractSchemaManager $schemaManager)
$schema = $schemaManager->createSchema();
$table = $schema->createTable($this->tableName->toNative());
$table->addColumn(
'entity_id',
'guid',
array('length' => 36, 'notnull' => true)
);
'entity_type',
'string',
'title',
'text'
'uid',
'zip',
array('length' => 32)
'country',
array('length' => 2)
'created',
array('length' => 32, 'notnull' => true)
'updated',
'owning_domain',
array('length' => 256, 'notnull' => true)
'entity_iri',
array('length' => 256)
$table->setPrimaryKey(['entity_id']);
$schemaManager->createTable($table);