From a8a4a4b1f8fe8d57372db13e375c0291faf56c37 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 20 Dec 2022 23:30:54 +0100 Subject: [PATCH] Fix migrations --- app/.htaccess | 7 -- app/AppCache.php | 7 -- app/AppKernel.php | 106 -------------------- app/config/parameters_test.yml | 10 -- app/config/tests/parameters_test.mysql.yml | 10 -- app/config/tests/parameters_test.pgsql.yml | 10 -- app/config/tests/parameters_test.sqlite.yml | 12 --- migrations/Version20170606155640.php | 2 +- src/Entity/User.php | 2 +- 9 files changed, 2 insertions(+), 164 deletions(-) delete mode 100644 app/.htaccess delete mode 100644 app/AppCache.php delete mode 100644 app/AppKernel.php delete mode 100644 app/config/parameters_test.yml delete mode 100644 app/config/tests/parameters_test.mysql.yml delete mode 100644 app/config/tests/parameters_test.pgsql.yml delete mode 100644 app/config/tests/parameters_test.sqlite.yml diff --git a/app/.htaccess b/app/.htaccess deleted file mode 100644 index fb1de45bd..000000000 --- a/app/.htaccess +++ /dev/null @@ -1,7 +0,0 @@ - - Require all denied - - - Order deny,allow - Deny from all - diff --git a/app/AppCache.php b/app/AppCache.php deleted file mode 100644 index 639ec2cd7..000000000 --- a/app/AppCache.php +++ /dev/null @@ -1,7 +0,0 @@ -getEnvironment(), ['dev', 'test'], true)) { - $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); - $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); - $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); - - if ('test' === $this->getEnvironment()) { - $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); - } - - if ('dev' === $this->getEnvironment()) { - $bundles[] = new Symfony\Bundle\MakerBundle\MakerBundle(); - $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); - } - } - - return $bundles; - } - - public function getRootDir() - { - return __DIR__; - } - - public function getCacheDir() - { - return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); - } - - public function getLogDir() - { - return dirname(__DIR__) . '/var/logs'; - } - - public function registerContainerConfiguration(LoaderInterface $loader) - { - $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); - - $loader->load(function ($container) { - if ($container->getParameter('use_webpack_dev_server')) { - $container->loadFromExtension('framework', [ - 'assets' => [ - 'base_url' => 'http://localhost:8080/', - ], - ]); - } else { - $container->loadFromExtension('framework', [ - 'assets' => [ - 'base_url' => $container->getParameter('domain_name'), - ], - ]); - } - }); - - $loader->load(function (ContainerBuilder $container) { - // $container->setParameter('container.autowiring.strict_mode', true); - // $container->setParameter('container.dumper.inline_class_loader', true); - $container->addObjectResource($this); - }); - } -} diff --git a/app/config/parameters_test.yml b/app/config/parameters_test.yml deleted file mode 100644 index 257d2acec..000000000 --- a/app/config/parameters_test.yml +++ /dev/null @@ -1,10 +0,0 @@ -parameters: - test_database_driver: pdo_sqlite - test_database_host: 127.0.0.1 - test_database_port: null - test_database_name: null - test_database_user: null - test_database_password: null - test_database_path: "%env(TEST_DATABASE_PATH)%" - env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite" - test_database_charset: utf8 diff --git a/app/config/tests/parameters_test.mysql.yml b/app/config/tests/parameters_test.mysql.yml deleted file mode 100644 index d07d09256..000000000 --- a/app/config/tests/parameters_test.mysql.yml +++ /dev/null @@ -1,10 +0,0 @@ -parameters: - test_database_driver: pdo_mysql - test_database_host: 127.0.0.1 - test_database_port: 3306 - test_database_name: wallabag_test - test_database_user: root - test_database_password: root - test_database_path: ~ - env(TEST_DATABASE_PATH): ~ - test_database_charset: utf8mb4 diff --git a/app/config/tests/parameters_test.pgsql.yml b/app/config/tests/parameters_test.pgsql.yml deleted file mode 100644 index 2be37aa14..000000000 --- a/app/config/tests/parameters_test.pgsql.yml +++ /dev/null @@ -1,10 +0,0 @@ -parameters: - test_database_driver: pdo_pgsql - test_database_host: localhost - test_database_port: - test_database_name: wallabag_test - test_database_user: wallabag - test_database_password: wallabagrocks - test_database_path: ~ - env(TEST_DATABASE_PATH): ~ - test_database_charset: utf8 diff --git a/app/config/tests/parameters_test.sqlite.yml b/app/config/tests/parameters_test.sqlite.yml deleted file mode 100644 index 2b92d579f..000000000 --- a/app/config/tests/parameters_test.sqlite.yml +++ /dev/null @@ -1,12 +0,0 @@ -parameters: - test_database_driver: pdo_sqlite - test_database_host: localhost - test_database_port: - test_database_name: ~ - test_database_user: ~ - test_database_password: ~ - # Using an environnement variable in order to avoid the error "attempt to write a readonly database" - # when the schema is dropped then recreate - test_database_path: "%env(TEST_DATABASE_PATH)%" - env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite" - test_database_charset: utf8 diff --git a/migrations/Version20170606155640.php b/migrations/Version20170606155640.php index 2b3990ccd..133e5d5e5 100644 --- a/migrations/Version20170606155640.php +++ b/migrations/Version20170606155640.php @@ -13,7 +13,7 @@ class Version20170606155640 extends WallabagMigration { public function up(Schema $schema): void { - $this->skipIf(!$schema->hasTable($this->getTable('craue_config_setting')), 'Table already renamed'); + $this->skipIf(!$schema->hasTable($this->getTable('craue_config_setting')), 'Old migration (table name has changed)'); $apiUserRegistration = $this->container ->get('doctrine.orm.default_entity_manager') diff --git a/src/Entity/User.php b/src/Entity/User.php index a51f3f074..8bc3b8515 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -172,7 +172,7 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI * * @ORM\Column(type="json", nullable=true) */ - private $backupCodes; + private array $backupCodes; /** * @var bool