diff --git a/data/migrations/Version20160820191203.php b/data/migrations/Version20160820191203.php index 2d8a7c38..d0a4d673 100644 --- a/data/migrations/Version20160820191203.php +++ b/data/migrations/Version20160820191203.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace ShlinkMigrations; use Doctrine\DBAL\Schema\Schema; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; /** @@ -30,12 +30,12 @@ class Version20160820191203 extends AbstractMigration private function createTagsTable(Schema $schema): void { $table = $schema->createTable('tags'); - $table->addColumn('id', Type::BIGINT, [ + $table->addColumn('id', Types::BIGINT, [ 'unsigned' => true, 'autoincrement' => true, 'notnull' => true, ]); - $table->addColumn('name', Type::STRING, [ + $table->addColumn('name', Types::STRING, [ 'length' => 255, 'notnull' => true, ]); @@ -47,11 +47,11 @@ class Version20160820191203 extends AbstractMigration private function createShortUrlsInTagsTable(Schema $schema): void { $table = $schema->createTable('short_urls_in_tags'); - $table->addColumn('short_url_id', Type::BIGINT, [ + $table->addColumn('short_url_id', Types::BIGINT, [ 'unsigned' => true, 'notnull' => true, ]); - $table->addColumn('tag_id', Type::BIGINT, [ + $table->addColumn('tag_id', Types::BIGINT, [ 'unsigned' => true, 'notnull' => true, ]); diff --git a/data/migrations/Version20171021093246.php b/data/migrations/Version20171021093246.php index 6e42d775..b66a2c3f 100644 --- a/data/migrations/Version20171021093246.php +++ b/data/migrations/Version20171021093246.php @@ -6,7 +6,7 @@ namespace ShlinkMigrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; /** @@ -24,10 +24,10 @@ class Version20171021093246 extends AbstractMigration return; } - $shortUrls->addColumn('valid_since', Type::DATETIME, [ + $shortUrls->addColumn('valid_since', Types::DATETIME, [ 'notnull' => false, ]); - $shortUrls->addColumn('valid_until', Type::DATETIME, [ + $shortUrls->addColumn('valid_until', Types::DATETIME, [ 'notnull' => false, ]); } diff --git a/data/migrations/Version20171022064541.php b/data/migrations/Version20171022064541.php index 36bfdc7b..7ff39666 100644 --- a/data/migrations/Version20171022064541.php +++ b/data/migrations/Version20171022064541.php @@ -6,7 +6,7 @@ namespace ShlinkMigrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; /** @@ -24,7 +24,7 @@ class Version20171022064541 extends AbstractMigration return; } - $shortUrls->addColumn('max_visits', Type::INTEGER, [ + $shortUrls->addColumn('max_visits', Types::INTEGER, [ 'unsigned' => true, 'notnull' => false, ]); diff --git a/data/migrations/Version20181020060559.php b/data/migrations/Version20181020060559.php index 86d46358..5b46b6df 100644 --- a/data/migrations/Version20181020060559.php +++ b/data/migrations/Version20181020060559.php @@ -8,7 +8,7 @@ use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; /** @@ -35,7 +35,7 @@ final class Version20181020060559 extends AbstractMigration { foreach ($columnNames as $name) { if (! $visitLocations->hasColumn($name)) { - $visitLocations->addColumn($name, Type::STRING, ['notnull' => false]); + $visitLocations->addColumn($name, Types::STRING, ['notnull' => false]); } } } diff --git a/data/migrations/Version20190930165521.php b/data/migrations/Version20190930165521.php index 120f1c16..2e4e8f50 100644 --- a/data/migrations/Version20190930165521.php +++ b/data/migrations/Version20190930165521.php @@ -6,7 +6,7 @@ namespace ShlinkMigrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\SchemaException; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\Migrations\AbstractMigration; final class Version20190930165521 extends AbstractMigration @@ -22,19 +22,19 @@ final class Version20190930165521 extends AbstractMigration } $domains = $schema->createTable('domains'); - $domains->addColumn('id', Type::BIGINT, [ + $domains->addColumn('id', Types::BIGINT, [ 'unsigned' => true, 'autoincrement' => true, 'notnull' => true, ]); - $domains->addColumn('authority', Type::STRING, [ + $domains->addColumn('authority', Types::STRING, [ 'length' => 512, 'notnull' => true, ]); $domains->addUniqueIndex(['authority']); $domains->setPrimaryKey(['id']); - $shortUrls->addColumn('domain_id', Type::BIGINT, [ + $shortUrls->addColumn('domain_id', Types::BIGINT, [ 'unsigned' => true, 'notnull' => false, ]); diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Domain.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Domain.php index b3afe195..de7252ee 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Domain.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Domain.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; use Doctrine\ORM\Mapping\ClassMetadata; // @codingStandardsIgnoreLine @@ -13,13 +13,13 @@ $builder = new ClassMetadataBuilder($metadata); $builder->setTable('domains'); -$builder->createField('id', Type::BIGINT) +$builder->createField('id', Types::BIGINT) ->columnName('id') ->makePrimaryKey() ->generatedValue('IDENTITY') ->option('unsigned', true) ->build(); -$builder->createField('authority', Type::STRING) +$builder->createField('authority', Types::STRING) ->unique() ->build(); diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php index 76e5ae7b..0d24d555 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; use Doctrine\ORM\Mapping\ClassMetadata; // @codingStandardsIgnoreLine use Shlinkio\Shlink\Common\Doctrine\Type\ChronosDateTimeType; @@ -15,19 +15,19 @@ $builder = new ClassMetadataBuilder($metadata); $builder->setTable('short_urls') ->setCustomRepositoryClass(Repository\ShortUrlRepository::class); -$builder->createField('id', Type::BIGINT) +$builder->createField('id', Types::BIGINT) ->columnName('id') ->makePrimaryKey() ->generatedValue('IDENTITY') ->option('unsigned', true) ->build(); -$builder->createField('longUrl', Type::STRING) +$builder->createField('longUrl', Types::STRING) ->columnName('original_url') ->length(2048) ->build(); -$builder->createField('shortCode', Type::STRING) +$builder->createField('shortCode', Types::STRING) ->columnName('short_code') ->length(255) ->build(); @@ -46,7 +46,7 @@ $builder->createField('validUntil', ChronosDateTimeType::CHRONOS_DATETIME) ->nullable() ->build(); -$builder->createField('maxVisits', Type::INTEGER) +$builder->createField('maxVisits', Types::INTEGER) ->columnName('max_visits') ->nullable() ->build(); diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Tag.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Tag.php index 8ecaa2c6..09a98151 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Tag.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Tag.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; use Doctrine\ORM\Mapping\ClassMetadata; // @codingStandardsIgnoreLine @@ -14,13 +14,13 @@ $builder = new ClassMetadataBuilder($metadata); $builder->setTable('tags') ->setCustomRepositoryClass(Repository\TagRepository::class); -$builder->createField('id', Type::BIGINT) +$builder->createField('id', Types::BIGINT) ->columnName('id') ->makePrimaryKey() ->generatedValue('IDENTITY') ->option('unsigned', true) ->build(); -$builder->createField('name', Type::STRING) +$builder->createField('name', Types::STRING) ->unique() ->build(); diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Visit.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Visit.php index c30b83c9..6770f9d3 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Visit.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.Visit.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; use Doctrine\ORM\Mapping\ClassMetadata; // @codingStandardsIgnoreLine use Shlinkio\Shlink\Common\Doctrine\Type\ChronosDateTimeType; @@ -16,14 +16,14 @@ $builder = new ClassMetadataBuilder($metadata); $builder->setTable('visits') ->setCustomRepositoryClass(Repository\VisitRepository::class); -$builder->createField('id', Type::BIGINT) +$builder->createField('id', Types::BIGINT) ->columnName('id') ->makePrimaryKey() ->generatedValue('IDENTITY') ->option('unsigned', true) ->build(); -$builder->createField('referer', Type::STRING) +$builder->createField('referer', Types::STRING) ->nullable() ->length(Visitor::REFERER_MAX_LENGTH) ->build(); @@ -32,13 +32,13 @@ $builder->createField('date', ChronosDateTimeType::CHRONOS_DATETIME) ->columnName('`date`') ->build(); -$builder->createField('remoteAddr', Type::STRING) +$builder->createField('remoteAddr', Types::STRING) ->columnName('remote_addr') ->length(Visitor::REMOTE_ADDRESS_MAX_LENGTH) ->nullable() ->build(); -$builder->createField('userAgent', Type::STRING) +$builder->createField('userAgent', Types::STRING) ->columnName('user_agent') ->length(Visitor::USER_AGENT_MAX_LENGTH) ->nullable() diff --git a/module/Rest/config/entities-mappings/Shlinkio.Shlink.Rest.Entity.ApiKey.php b/module/Rest/config/entities-mappings/Shlinkio.Shlink.Rest.Entity.ApiKey.php index 3b7c2e60..5bc5aec9 100644 --- a/module/Rest/config/entities-mappings/Shlinkio.Shlink.Rest.Entity.ApiKey.php +++ b/module/Rest/config/entities-mappings/Shlinkio.Shlink.Rest.Entity.ApiKey.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; use Doctrine\ORM\Mapping\ClassMetadata; // @codingStandardsIgnoreLine use Shlinkio\Shlink\Common\Doctrine\Type\ChronosDateTimeType; @@ -14,13 +14,13 @@ $builder = new ClassMetadataBuilder($metadata); $builder->setTable('api_keys'); -$builder->createField('id', Type::BIGINT) +$builder->createField('id', Types::BIGINT) ->makePrimaryKey() ->generatedValue('IDENTITY') ->option('unsigned', true) ->build(); -$builder->createField('key', Type::STRING) +$builder->createField('key', Types::STRING) ->columnName('`key`') ->unique() ->build(); @@ -30,5 +30,5 @@ $builder->createField('expirationDate', ChronosDateTimeType::CHRONOS_DATETIME) ->nullable() ->build(); -$builder->createField('enabled', Type::BOOLEAN) +$builder->createField('enabled', Types::BOOLEAN) ->build();