1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Update all Doctrine deps

Also update these deps to be compatible with latest Doctrine version:
- `friendsofsymfony/oauth-server-bundle`
- `lexik/form-filter-bundle`
- `dama/doctrine-test-bundle`
This commit is contained in:
Jeremy Benoist 2022-12-14 14:36:29 +01:00
parent 8f473ecf5c
commit b3099f68c5
No known key found for this signature in database
GPG key ID: 7168D5DD29F38552
53 changed files with 565 additions and 688 deletions

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20160401000000 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
@ -70,7 +70,7 @@ CREATE TABLE {$this->getTable('oauth2_clients')} (id INT AUTO_INCREMENT NOT NULL
CREATE TABLE {$this->getTable('oauth2_access_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_refresh_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_auth_codes')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('user')} (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('user')} (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('annotation')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE {$this->getTable('entry')} ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id);
@ -127,7 +127,7 @@ CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON {$this->getTable('user')} (username
CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON {$this->getTable('user')} (email_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON {$this->getTable('user')} (confirmation_token);
COMMENT ON COLUMN {$this->getTable('user')}.roles IS '(DC2Type:array)';
COMMENT ON COLUMN {$this->getTable('user')}.trusted IS '(DC2Type:json_array)';
COMMENT ON COLUMN {$this->getTable('user')}.trusted IS '(DC2Type:json)';
CREATE TABLE {$this->getTable('annotation')} (id INT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, quote VARCHAR(255) NOT NULL, ranges TEXT NOT NULL, PRIMARY KEY(id));
CREATE INDEX IDX_A7AED006A76ED395 ON {$this->getTable('annotation')} (user_id);
CREATE INDEX IDX_A7AED006BA364942 ON {$this->getTable('annotation')} (entry_id);
@ -164,7 +164,7 @@ SQL
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql("DROP TABLE {$this->getTable('craue_config_setting')}");
$this->addSql("DROP TABLE {$this->getTable('tagging_rule')}");

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20160410190541 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -24,14 +24,14 @@ class Version20160410190541 extends WallabagMigration
$sharePublic = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'");
if (false === $sharePublic) {
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('share_public', '1', 'entry')");
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$entryTable->dropColumn('uid');

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20160812120952 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
@ -31,7 +31,7 @@ class Version20160812120952 extends WallabagMigration
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));

View file

@ -10,12 +10,12 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20160911214952 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$redis = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis'");
if (false === $redis) {
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('import_with_redis', 0, 'import')");
@ -24,7 +24,7 @@ class Version20160911214952 extends WallabagMigration
$rabbitmq = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq'");
if (false === $rabbitmq) {
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')");
@ -33,7 +33,7 @@ class Version20160911214952 extends WallabagMigration
$this->skipIf(false !== $rabbitmq && false !== $redis, 'It seems that you already played this migration.');
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq';");

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20160916201049 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$configTable = $schema->getTable($this->getTable('config'));
@ -20,7 +20,7 @@ class Version20160916201049 extends WallabagMigration
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'pocket_consumer_key';");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$configTable = $schema->getTable($this->getTable('config'));
$configTable->dropColumn('pocket_consumer_key');

View file

@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161001072726 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
@ -24,9 +24,8 @@ class Version20161001072726 extends WallabagMigration
WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%'
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
);
$query->execute();
foreach ($query->fetchAll() as $fk) {
foreach ($query->fetchAllAssociative() as $fk) {
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
}
break;
@ -42,9 +41,8 @@ class Version20161001072726 extends WallabagMigration
AND conrelid::regclass::text = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "'
AND n.nspname = 'public';"
);
$query->execute();
foreach ($query->fetchAll() as $fk) {
foreach ($query->fetchAllAssociative() as $fk) {
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP CONSTRAINT ' . $fk['conname']);
}
break;
@ -65,9 +63,8 @@ class Version20161001072726 extends WallabagMigration
AND COLUMN_NAME = 'entry_id'
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
);
$query->execute();
foreach ($query->fetchAll() as $fk) {
foreach ($query->fetchAllAssociative() as $fk) {
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
}
break;
@ -84,9 +81,8 @@ class Version20161001072726 extends WallabagMigration
AND n.nspname = 'public'
AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';"
);
$query->execute();
foreach ($query->fetchAll() as $fk) {
foreach ($query->fetchAllAssociative() as $fk) {
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP CONSTRAINT ' . $fk['conname']);
}
break;
@ -95,7 +91,7 @@ class Version20161001072726 extends WallabagMigration
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES ' . $this->getTable('entry') . ' (id) ON DELETE CASCADE');
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
throw new SkipMigrationException('Too complex ...');
}

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161022134138 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
@ -38,7 +38,7 @@ class Version20161022134138 extends WallabagMigration
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE `name` `name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');

View file

@ -12,7 +12,7 @@ class Version20161024212538 extends WallabagMigration
{
private $constraintName = 'IDX_user_oauth_client';
public function up(Schema $schema)
public function up(Schema $schema): void
{
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
@ -29,7 +29,7 @@ class Version20161024212538 extends WallabagMigration
);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));

View file

@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161031132655 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$images = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled'");
$this->skipIf(false !== $images, 'It seems that you already played this migration.');
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('download_images_enabled', 0, 'misc')");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled';");
}

View file

@ -12,7 +12,7 @@ class Version20161104073720 extends WallabagMigration
{
private $indexName = 'IDX_entry_created_at';
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');
@ -20,7 +20,7 @@ class Version20161104073720 extends WallabagMigration
$entryTable->addIndex(['created_at'], $this->indexName);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161106113822 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$configTable = $schema->getTable($this->getTable('config'));
@ -22,7 +22,7 @@ class Version20161106113822 extends WallabagMigration
]);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$configTable = $schema->getTable($this->getTable('config'));

View file

@ -10,12 +10,12 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161117071626 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$share = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark'");
if (false === $share) {
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('share_unmark', 0, 'entry')");
@ -24,7 +24,7 @@ class Version20161117071626 extends WallabagMigration
$unmark = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url'");
if (false === $unmark) {
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')");
@ -33,7 +33,7 @@ class Version20161117071626 extends WallabagMigration
$this->skipIf(false !== $share && false !== $unmark, 'It seems that you already played this migration.');
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url';");

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161118134328 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -22,7 +22,7 @@ class Version20161118134328 extends WallabagMigration
]);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161122144743 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$access = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access'");
$this->skipIf(false !== $access, 'It seems that you already played this migration.');
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('restricted_access', 0, 'entry')");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access';");
}

View file

@ -18,7 +18,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161122203647 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$userTable = $schema->getTable($this->getTable('user'));
@ -28,7 +28,7 @@ class Version20161122203647 extends WallabagMigration
$userTable->dropColumn('credentials_expired');
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$userTable = $schema->getTable($this->getTable('user'));

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161128084725 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$configTable = $schema->getTable($this->getTable('config'));
$this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.');
@ -18,7 +18,7 @@ class Version20161128084725 extends WallabagMigration
$configTable->addColumn('list_mode', 'integer', ['notnull' => false]);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$configTable = $schema->getTable($this->getTable('config'));
$configTable->dropColumn('list_mode');

View file

@ -16,7 +16,7 @@ class Version20161128131503 extends WallabagMigration
'expires_at' => 'datetime',
];
public function up(Schema $schema)
public function up(Schema $schema): void
{
$userTable = $schema->getTable($this->getTable('user'));
@ -26,7 +26,7 @@ class Version20161128131503 extends WallabagMigration
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$userTable = $schema->getTable($this->getTable('user'));

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20161214094402 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -32,7 +32,7 @@ class Version20161214094402 extends WallabagMigration
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -12,7 +12,7 @@ class Version20161214094403 extends WallabagMigration
{
private $indexName = 'IDX_entry_uid';
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');
@ -20,7 +20,7 @@ class Version20161214094403 extends WallabagMigration
$entryTable->addIndex(['uid'], $this->indexName);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');

View file

@ -13,7 +13,7 @@ class Version20170127093841 extends WallabagMigration
private $indexStarredName = 'IDX_entry_starred';
private $indexArchivedName = 'IDX_entry_archived';
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf($entryTable->hasIndex($this->indexStarredName) && $entryTable->hasIndex($this->indexArchivedName), 'It seems that you already played this migration.');
@ -22,7 +22,7 @@ class Version20170127093841 extends WallabagMigration
$entryTable->addIndex(['is_archived'], $this->indexArchivedName);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf(false === $entryTable->hasIndex($this->indexStarredName) && false === $entryTable->hasIndex($this->indexArchivedName), 'It seems that you already played this migration.');

View file

@ -10,12 +10,12 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170327194233 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$scuttle = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle'");
$this->skipIf(false !== $scuttle, 'It seems that you already played this migration.');
@ -23,7 +23,7 @@ class Version20170327194233 extends WallabagMigration
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('scuttle_url', 'http://scuttle.org', 'entry')");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'scuttle_url';");

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170405182620 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -27,7 +27,7 @@ class Version20170405182620 extends WallabagMigration
]);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170407200919 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf(!$entryTable->hasColumn('is_public'), 'It seems that you already played this migration.');
@ -18,7 +18,7 @@ class Version20170407200919 extends WallabagMigration
$entryTable->dropColumn('is_public');
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf($entryTable->hasColumn('is_public'), 'It seems that you already played this migration.');

View file

@ -10,17 +10,17 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170420134133 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_pictures';");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$downloadPictures = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_pictures'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_pictures'");
$this->skipIf(false !== $downloadPictures, 'It seems that you already played this migration.');

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170501115751 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->skipIf($schema->hasTable($this->getTable('site_credential')), 'It seems that you already played this migration.');
@ -31,7 +31,7 @@ class Version20170501115751 extends WallabagMigration
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$schema->dropTable($this->getTable('site_credential'));
}

View file

@ -17,7 +17,7 @@ class Version20170510082609 extends WallabagMigration
'email_canonical',
];
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
@ -26,7 +26,7 @@ class Version20170510082609 extends WallabagMigration
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170511115400 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -21,7 +21,7 @@ class Version20170511115400 extends WallabagMigration
]);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170511211659 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
@ -62,7 +62,7 @@ EOD
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$tableName = $this->getTable('annotation');

View file

@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170602075214 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$apiUserRegistration = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration'");
$this->skipIf(false !== $apiUserRegistration, 'It seems that you already played this migration.');
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('api_user_registration', '0', 'api')");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration';");
}

View file

@ -11,19 +11,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170606155640 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$apiUserRegistration = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'");
$this->skipIf(false === $apiUserRegistration, 'It seems that you already played this migration.');
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')");
}

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170719231144 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
@ -21,13 +21,12 @@ class Version20170719231144 extends WallabagMigration
GROUP BY LOWER(label)
HAVING COUNT(*) > 1'
);
$dupTags->execute();
foreach ($dupTags->fetchAll() as $duplicates) {
foreach ($dupTags->fetchAllAssociative() as $duplicates) {
$label = $duplicates['lower_label'];
// Retrieve all duplicate tags for a given tag
$tags = $this->connection->executeQuery('
$tags = $this->connection->query('
SELECT id
FROM ' . $this->getTable('tag') . '
WHERE LOWER(label) = :label
@ -41,7 +40,7 @@ class Version20170719231144 extends WallabagMigration
$newId = null;
$ids = [];
foreach ($tags->fetchAll() as $tag) {
foreach ($tags->fetchAllAssociative() as $tag) {
// Ignore the first tag as we use it as the new reference tag
if ($first) {
$first = false;
@ -86,7 +85,7 @@ class Version20170719231144 extends WallabagMigration
);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
throw new SkipMigrationException('Too complex ...');
}

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20170824113337 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -21,7 +21,7 @@ class Version20170824113337 extends WallabagMigration
]);
}
public function postUp(Schema $schema)
public function postUp(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf(!$entryTable->hasColumn('starred_at'), 'Unable to add starred_at colum');
@ -34,7 +34,7 @@ class Version20170824113337 extends WallabagMigration
);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20171008195606 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
@ -26,7 +26,7 @@ class Version20171008195606 extends WallabagMigration
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20171105202000 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -21,7 +21,7 @@ class Version20171105202000 extends WallabagMigration
]);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20171120163128 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$storeArticleHeaders = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers'");
$this->skipIf(false !== $storeArticleHeaders, 'It seems that you already played this migration.');
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('store_article_headers', '0', 'entry')");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';");
}

View file

@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20171125164500 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$shaarliShareOriginUrl = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url'");
$this->skipIf(false !== $shaarliShareOriginUrl, 'It seems that you already played this migration.');
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('shaarli_share_origin_url', '0', 'entry')");
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url';");
}

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20180405182455 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -21,7 +21,7 @@ class Version20180405182455 extends WallabagMigration
]);
}
public function postUp(Schema $schema)
public function postUp(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf(!$entryTable->hasColumn('archived_at'), 'Unable to add archived_at colum');
@ -34,7 +34,7 @@ class Version20180405182455 extends WallabagMigration
);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20181128203230 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
@ -25,7 +25,7 @@ class Version20181128203230 extends WallabagMigration
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `value` `value` varchar(191)');
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');

View file

@ -20,7 +20,7 @@ final class Version20181202073750 extends WallabagMigration
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('user', true) . ' AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, twoFactorAuthentication FROM ' . $this->getTable('user', true) . '');
$this->addSql('DROP TABLE ' . $this->getTable('user', true) . '');
$this->addSql('CREATE TABLE ' . $this->getTable('user', true) . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL COLLATE BINARY, username_canonical VARCHAR(180) NOT NULL COLLATE BINARY, email VARCHAR(180) NOT NULL COLLATE BINARY, email_canonical VARCHAR(180) NOT NULL COLLATE BINARY, enabled BOOLEAN NOT NULL, password VARCHAR(255) NOT NULL COLLATE BINARY, last_login DATETIME DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, emailTwoFactor BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json_array)
, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json)
)');
$this->addSql('INSERT INTO ' . $this->getTable('user', true) . ' (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, emailTwoFactor) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, twoFactorAuthentication FROM __temp__' . $this->getTable('user', true) . '');
$this->addSql('DROP TABLE __temp__' . $this->getTable('user', true) . '');
@ -32,7 +32,7 @@ final class Version20181202073750 extends WallabagMigration
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
break;
case 'postgresql':
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');

View file

@ -118,13 +118,13 @@ final class Version20190129120000 extends WallabagMigration
],
];
public function up(Schema $schema)
public function up(Schema $schema): void
{
foreach ($this->settings as $setting) {
$settingEnabled = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = '" . $setting['name'] . "'");
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = '" . $setting['name'] . "'");
if (false !== $settingEnabled) {
continue;
@ -134,7 +134,7 @@ final class Version20190129120000 extends WallabagMigration
}
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->skipIf(true, 'These settings are required and should not be removed.');
}

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20190401105353 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -24,7 +24,7 @@ class Version20190401105353 extends WallabagMigration
$entryTable->addIndex(['user_id', 'hashed_url'], 'hashed_url_user_id', [], ['lengths' => [null, 40]]);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
*/
class Version20190601125843 extends WallabagMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));
@ -31,7 +31,7 @@ class Version20190601125843 extends WallabagMigration
$entryTable->addIndex(['user_id', 'hashed_given_url'], 'hashed_given_url_user_id', [], ['lengths' => [null, 40]]);
}
public function down(Schema $schema)
public function down(Schema $schema): void
{
$entryTable = $schema->getTable($this->getTable('entry'));

View file

@ -48,7 +48,7 @@ final class Version20190826204730 extends WallabagMigration
$previous_rule = $this->container
->get('doctrine.orm.default_entity_manager')
->getConnection()
->fetchArray('SELECT * FROM ' . $this->getTable('ignore_origin_instance_rule') . " WHERE rule = '" . $entity['rule'] . "'");
->fetchOne('SELECT * FROM ' . $this->getTable('ignore_origin_instance_rule') . " WHERE rule = '" . $entity['rule'] . "'");
if (false === $previous_rule) {
$this->addSql('INSERT INTO ' . $this->getTable('ignore_origin_instance_rule') . " (rule) VALUES ('" . $entity['rule'] . "');");