Compare commits

...

5 Commits

Author SHA1 Message Date
Alejandro Celaya
be35349350 Fixed typo 2021-03-12 16:22:53 +01:00
Alejandro Celaya
771fd74978 Merge pull request #1049 from acelaya-forks/feature/mysql-migrations-error
Feature/mysql migrations error
2021-03-12 16:22:13 +01:00
Alejandro Celaya
3ba9ee7bf1 Updated changelog 2021-03-12 11:56:41 +01:00
Alejandro Celaya
a0062a62e8 Ensured all migrations are non-transactional, which allows woring around an issue in doctrine-migrations 2021-03-12 11:52:43 +01:00
Alejandro Celaya
0f2bd77ebc Fixed dependencies pinned to older versions 2021-03-12 08:54:23 +01:00
25 changed files with 219 additions and 22 deletions

View File

@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).
## [2.6.2] - 2021-03-12
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#1047](https://github.com/shlinkio/shlink/issues/1047) Fixed error in migrations when doing a fresh installation using PHP8 and MySQL/Mariadb databases.
## [2.6.1] - 2021-02-22 ## [2.6.1] - 2021-02-22
### Added ### Added
* *Nothing* * *Nothing*

View File

@@ -21,10 +21,10 @@
"doctrine/cache": "^1.9", "doctrine/cache": "^1.9",
"doctrine/migrations": "^3.0.2", "doctrine/migrations": "^3.0.2",
"doctrine/orm": "2.8.1 || ^2.8.3", "doctrine/orm": "2.8.1 || ^2.8.3",
"endroid/qr-code": "dev-master#0f1613a as 3.10", "endroid/qr-code": "3.x-dev#0f1613a as 3.10",
"geoip2/geoip2": "^2.9", "geoip2/geoip2": "^2.9",
"guzzlehttp/guzzle": "^7.0", "guzzlehttp/guzzle": "^7.0",
"happyr/doctrine-specification": "2.0.x-dev#cb116d3 as 2.0", "happyr/doctrine-specification": "2.x-dev#cb116d3 as 2.0",
"laminas/laminas-config": "^3.3", "laminas/laminas-config": "^3.3",
"laminas/laminas-config-aggregator": "^1.1", "laminas/laminas-config-aggregator": "^1.1",
"laminas/laminas-diactoros": "^2.1.3", "laminas/laminas-diactoros": "^2.1.3",
@@ -70,7 +70,7 @@
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-master", "roave/security-advisories": "dev-master",
"shlinkio/php-coding-standard": "~2.1.1", "shlinkio/php-coding-standard": "~2.1.1",
"shlinkio/shlink-test-utils": "^2.0", "shlinkio/shlink-test-utils": "^2.1",
"symfony/var-dumper": "^5.2", "symfony/var-dumper": "^5.2",
"veewee/composer-run-parallel": "^0.1.0" "veewee/composer-run-parallel": "^0.1.0"
}, },

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations; namespace ShlinkMigrations;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
@@ -18,7 +18,7 @@ class Version20160819142757 extends AbstractMigration
private const SQLITE = 'sqlite'; private const SQLITE = 'sqlite';
/** /**
* @throws DBALException * @throws Exception
* @throws SchemaException * @throws SchemaException
*/ */
public function up(Schema $schema): void public function up(Schema $schema): void
@@ -35,10 +35,18 @@ class Version20160819142757 extends AbstractMigration
} }
/** /**
* @throws DBALException * @throws Exception
*/ */
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
$db = $this->connection->getDatabasePlatform()->getName(); $db = $this->connection->getDatabasePlatform()->getName();
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -73,4 +73,12 @@ class Version20160820191203 extends AbstractMigration
$schema->dropTable('short_urls_in_tags'); $schema->dropTable('short_urls_in_tags');
$schema->dropTable('tags'); $schema->dropTable('tags');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -45,4 +45,12 @@ class Version20171021093246 extends AbstractMigration
$shortUrls->dropColumn('valid_since'); $shortUrls->dropColumn('valid_since');
$shortUrls->dropColumn('valid_until'); $shortUrls->dropColumn('valid_until');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -42,4 +42,12 @@ class Version20171022064541 extends AbstractMigration
$shortUrls->dropColumn('max_visits'); $shortUrls->dropColumn('max_visits');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -39,4 +39,12 @@ final class Version20180801183328 extends AbstractMigration
{ {
$schema->getTable('short_urls')->getColumn('short_code')->setLength($size); $schema->getTable('short_urls')->getColumn('short_code')->setLength($size);
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations; namespace ShlinkMigrations;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use PDO; use PDO;
@@ -16,15 +16,13 @@ use Shlinkio\Shlink\Common\Util\IpAddress;
*/ */
final class Version20180913205455 extends AbstractMigration final class Version20180913205455 extends AbstractMigration
{ {
/**
*/
public function up(Schema $schema): void public function up(Schema $schema): void
{ {
// Nothing to create // Nothing to create
} }
/** /**
* @throws DBALException * @throws Exception
*/ */
public function postUp(Schema $schema): void public function postUp(Schema $schema): void
{ {
@@ -64,10 +62,16 @@ final class Version20180913205455 extends AbstractMigration
} }
} }
/**
*/
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
// Nothing to rollback // Nothing to rollback
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -47,4 +47,12 @@ final class Version20180915110857 extends AbstractMigration
{ {
// Nothing to run // Nothing to run
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations; namespace ShlinkMigrations;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
@@ -42,7 +42,7 @@ final class Version20181020060559 extends AbstractMigration
/** /**
* @throws SchemaException * @throws SchemaException
* @throws DBALException * @throws Exception
*/ */
public function postUp(Schema $schema): void public function postUp(Schema $schema): void
{ {
@@ -65,4 +65,12 @@ final class Version20181020060559 extends AbstractMigration
{ {
// No down // No down
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -38,4 +38,12 @@ final class Version20181020065148 extends AbstractMigration
{ {
// No down // No down
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -34,4 +34,12 @@ final class Version20181110175521 extends AbstractMigration
{ {
return $schema->getTable('visits')->getColumn('user_agent'); return $schema->getTable('visits')->getColumn('user_agent');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -34,4 +34,12 @@ final class Version20190824075137 extends AbstractMigration
{ {
return $schema->getTable('visits')->getColumn('referer'); return $schema->getTable('visits')->getColumn('referer');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -52,4 +52,12 @@ final class Version20190930165521 extends AbstractMigration
$schema->getTable('short_urls')->dropColumn('domain_id'); $schema->getTable('short_urls')->dropColumn('domain_id');
$schema->dropTable('domains'); $schema->dropTable('domains');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -46,4 +46,12 @@ final class Version20191001201532 extends AbstractMigration
$shortUrls->dropIndex('unique_short_code_plus_domain'); $shortUrls->dropIndex('unique_short_code_plus_domain');
$shortUrls->addUniqueIndex(['short_code']); $shortUrls->addUniqueIndex(['short_code']);
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -34,4 +34,12 @@ final class Version20191020074522 extends AbstractMigration
{ {
return $schema->getTable('short_urls')->getColumn('original_url'); return $schema->getTable('short_urls')->getColumn('original_url');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations; namespace ShlinkMigrations;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
@@ -16,7 +16,7 @@ final class Version20200105165647 extends AbstractMigration
private const COLUMNS = ['lat' => 'latitude', 'lon' => 'longitude']; private const COLUMNS = ['lat' => 'latitude', 'lon' => 'longitude'];
/** /**
* @throws DBALException * @throws Exception
*/ */
public function preUp(Schema $schema): void public function preUp(Schema $schema): void
{ {
@@ -43,7 +43,7 @@ final class Version20200105165647 extends AbstractMigration
} }
/** /**
* @throws DBALException * @throws Exception
*/ */
public function up(Schema $schema): void public function up(Schema $schema): void
{ {
@@ -57,7 +57,7 @@ final class Version20200105165647 extends AbstractMigration
} }
/** /**
* @throws DBALException * @throws Exception
*/ */
public function postUp(Schema $schema): void public function postUp(Schema $schema): void
{ {
@@ -83,7 +83,7 @@ final class Version20200105165647 extends AbstractMigration
} }
/** /**
* @throws DBALException * @throws Exception
*/ */
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
@@ -93,4 +93,12 @@ final class Version20200105165647 extends AbstractMigration
$visitLocations->dropColumn($colName); $visitLocations->dropColumn($colName);
} }
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations; namespace ShlinkMigrations;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
@@ -16,7 +16,7 @@ final class Version20200106215144 extends AbstractMigration
private const COLUMNS = ['latitude', 'longitude']; private const COLUMNS = ['latitude', 'longitude'];
/** /**
* @throws DBALException * @throws Exception
*/ */
public function up(Schema $schema): void public function up(Schema $schema): void
{ {
@@ -32,7 +32,7 @@ final class Version20200106215144 extends AbstractMigration
} }
/** /**
* @throws DBALException * @throws Exception
*/ */
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
@@ -44,4 +44,12 @@ final class Version20200106215144 extends AbstractMigration
]); ]);
} }
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -50,4 +50,12 @@ final class Version20200110182849 extends AbstractMigration
{ {
// No need (and no way) to undo this migration // No need (and no way) to undo this migration
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -42,4 +42,12 @@ final class Version20200323190014 extends AbstractMigration
$visitLocations->dropColumn('is_empty'); $visitLocations->dropColumn('is_empty');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -24,4 +24,12 @@ final class Version20200503170404 extends AbstractMigration
$this->skipIf(! $visits->hasIndex(self::INDEX_NAME)); $this->skipIf(! $visits->hasIndex(self::INDEX_NAME));
$visits->dropIndex(self::INDEX_NAME); $visits->dropIndex(self::INDEX_NAME);
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -41,4 +41,12 @@ final class Version20201023090929 extends AbstractMigration
$shortUrls->dropColumn('import_original_short_code'); $shortUrls->dropColumn('import_original_short_code');
$shortUrls->dropIndex('unique_imports'); $shortUrls->dropIndex('unique_imports');
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -86,4 +86,12 @@ final class Version20201102113208 extends AbstractMigration
$shortUrls->removeForeignKey('FK_' . self::API_KEY_COLUMN); $shortUrls->removeForeignKey('FK_' . self::API_KEY_COLUMN);
$shortUrls->dropColumn(self::API_KEY_COLUMN); $shortUrls->dropColumn(self::API_KEY_COLUMN);
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -49,4 +49,12 @@ final class Version20210102174433 extends AbstractMigration
$schema->getTable(self::TABLE_NAME)->dropIndex('UQ_role_plus_api_key'); $schema->getTable(self::TABLE_NAME)->dropIndex('UQ_role_plus_api_key');
$schema->dropTable(self::TABLE_NAME); $schema->dropTable(self::TABLE_NAME);
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }

View File

@@ -23,4 +23,12 @@ final class Version20210118153932 extends AbstractMigration
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
} }
/**
* @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
*/
public function isTransactional(): bool
{
return false;
}
} }