shlink/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Domain.php

26 lines
647 B
PHP
Raw Normal View History

2019-09-30 12:42:27 -05:00
<?php
2019-10-05 10:26:10 -05:00
2019-09-30 12:42:27 -05:00
declare(strict_types=1);
namespace Shlinkio\Shlink\Core;
use Doctrine\DBAL\Types\Types;
2019-09-30 12:42:27 -05:00
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
use Doctrine\ORM\Mapping\ClassMetadata; // @codingStandardsIgnoreLine
2019-10-05 10:26:10 -05:00
/** @var $metadata ClassMetadata */ // @codingStandardsIgnoreLine
2019-09-30 12:42:27 -05:00
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('domains');
$builder->createField('id', Types::BIGINT)
2019-09-30 12:42:27 -05:00
->columnName('id')
->makePrimaryKey()
->generatedValue('IDENTITY')
->option('unsigned', true)
->build();
$builder->createField('authority', Types::STRING)
2019-09-30 12:42:27 -05:00
->unique()
->build();