mirror of
https://github.com/shlinkio/shlink.git
synced 2025-01-05 21:53:22 -06:00
27 lines
703 B
PHP
27 lines
703 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\Core;
|
|
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
|
|
use Doctrine\ORM\Mapping\ClassMetadata;
|
|
|
|
return static function (ClassMetadata $metadata, array $emConfig): void {
|
|
$builder = new ClassMetadataBuilder($metadata);
|
|
|
|
$builder->setTable(determineTableName('domains', $emConfig));
|
|
|
|
$builder->createField('id', Types::BIGINT)
|
|
->columnName('id')
|
|
->makePrimaryKey()
|
|
->generatedValue('IDENTITY')
|
|
->option('unsigned', true)
|
|
->build();
|
|
|
|
$builder->createField('authority', Types::STRING)
|
|
->unique()
|
|
->build();
|
|
};
|