mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-26 08:51:13 -06:00
33 lines
822 B
PHP
33 lines
822 B
PHP
|
<?php
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace Shlinkio\Shlink\Rest;
|
||
|
|
||
|
use Doctrine\DBAL\Types\Type;
|
||
|
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
|
||
|
use Shlinkio\Shlink\Common\Type\ChronosDateTimeType;
|
||
|
|
||
|
/** @var $metadata ClassMetadata */
|
||
|
$builder = new ClassMetadataBuilder($metadata);
|
||
|
|
||
|
$builder->setTable('api_keys');
|
||
|
|
||
|
$builder->createField('id', Type::BIGINT)
|
||
|
->makePrimaryKey()
|
||
|
->generatedValue('IDENTITY')
|
||
|
->option('unsigned', true)
|
||
|
->build();
|
||
|
|
||
|
$builder->createField('key', Type::STRING)
|
||
|
->columnName('`key`')
|
||
|
->unique()
|
||
|
->build();
|
||
|
|
||
|
$builder->createField('expirationDate', ChronosDateTimeType::CHRONOS_DATETIME)
|
||
|
->columnName('expiration_date')
|
||
|
->nullable()
|
||
|
->build();
|
||
|
|
||
|
$builder->createField('enabled', Type::BOOLEAN)
|
||
|
->build();
|