Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"mezzio/mezzio-authorization-rbac": "^1.7.0",
"mezzio/mezzio-cors": "^1.11.1",
"mezzio/mezzio-fastroute": "^3.11.0",
"ramsey/uuid-doctrine": "^2.0.0",
"roave/psr-container-doctrine": "^4.1.0"
"ramsey/uuid-doctrine": "^2.1.0",
"roave/psr-container-doctrine": "^5.2.2"
},
"require-dev": {
"filp/whoops": "^2.15.4",
Expand Down
20 changes: 10 additions & 10 deletions config/autoload/doctrine.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,33 @@
],
],
'doctrine' => [
'connection' => [
'configuration' => [
'orm_default' => [
'entity_listener_resolver' => EntityListenerResolver::class,
],
],
'connection' => [
'orm_default' => [
'doctrine_mapping_types' => [
UuidBinaryType::NAME => 'binary',
UuidBinaryOrderedTimeType::NAME => 'binary',
],
],
],
'driver' => [
'driver' => [
// default metadata driver, aggregates all other drivers into a single one.
// Override `orm_default` only if you know what you're doing
'orm_default' => [
'orm_default' => [
'class' => MappingDriverChain::class,
'drivers' => [],
],
'configuration' => [
'orm_default' => [
'entity_listener_resolver' => EntityListenerResolver::class,
],
],
],
'types' => [
'types' => [
UuidType::NAME => UuidType::class,
UuidBinaryType::NAME => UuidBinaryType::class,
UuidBinaryOrderedTimeType::NAME => UuidBinaryOrderedTimeType::class,
],
'fixtures' => getcwd() . '/data/doctrine/fixtures',
'fixtures' => getcwd() . '/data/doctrine/fixtures',
],
'resultCacheLifetime' => 600,
];
2 changes: 1 addition & 1 deletion config/autoload/local.test.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ return [
'connection' => [
'orm_default' => [
'params' => [
'url' => 'sqlite:///:memory:',
'url' => 'sqlite3:///:memory:',
],
],
],
Expand Down
58 changes: 0 additions & 58 deletions data/doctrine/migrations/Version20220817121035.php

This file was deleted.

57 changes: 57 additions & 0 deletions data/doctrine/migrations/Version20240806123413.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

declare(strict_types=1);

namespace Frontend\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240806123413 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE contact_message (uuid BINARY(16) NOT NULL, email VARCHAR(150) NOT NULL, name VARCHAR(150) NOT NULL, subject LONGTEXT NOT NULL, message LONGTEXT NOT NULL, platform LONGTEXT NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('CREATE TABLE user (uuid BINARY(16) NOT NULL, identity VARCHAR(191) NOT NULL, password VARCHAR(191) NOT NULL, status ENUM(\'pending\', \'active\'), isDeleted TINYINT(1) NOT NULL, hash VARCHAR(64) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D6496A95E9C4 (identity), UNIQUE INDEX UNIQ_8D93D649D1B862B8 (hash), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('CREATE TABLE user_roles (userUuid BINARY(16) NOT NULL, roleUuid BINARY(16) NOT NULL, INDEX IDX_54FCD59FD73087E9 (userUuid), INDEX IDX_54FCD59F88446210 (roleUuid), PRIMARY KEY(userUuid, roleUuid)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('CREATE TABLE user_avatar (uuid BINARY(16) NOT NULL, name VARCHAR(191) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, userUuid BINARY(16) NOT NULL, UNIQUE INDEX UNIQ_73256912D73087E9 (userUuid), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('CREATE TABLE user_detail (uuid BINARY(16) NOT NULL, firstName VARCHAR(191) DEFAULT NULL, lastName VARCHAR(191) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, userUuid BINARY(16) NOT NULL, UNIQUE INDEX UNIQ_4B5464AED73087E9 (userUuid), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('CREATE TABLE user_remember_me (uuid BINARY(16) NOT NULL, rememberMeToken VARCHAR(100) NOT NULL, userAgent LONGTEXT NOT NULL, expireDate DATETIME NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, userUuid BINARY(16) NOT NULL, UNIQUE INDEX UNIQ_D3E96EBD1BBB86A0 (rememberMeToken), INDEX IDX_D3E96EBDD73087E9 (userUuid), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('CREATE TABLE user_reset_password (uuid BINARY(16) NOT NULL, expires DATETIME NOT NULL, hash VARCHAR(64) NOT NULL, status VARCHAR(20) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, userUuid BINARY(16) NOT NULL, UNIQUE INDEX UNIQ_D21DE3BCD1B862B8 (hash), INDEX IDX_D21DE3BCD73087E9 (userUuid), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('CREATE TABLE user_role (uuid BINARY(16) NOT NULL, name VARCHAR(30) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_2DE8C6A35E237E06 (name), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('ALTER TABLE user_roles ADD CONSTRAINT FK_54FCD59FD73087E9 FOREIGN KEY (userUuid) REFERENCES user (uuid)');
$this->addSql('ALTER TABLE user_roles ADD CONSTRAINT FK_54FCD59F88446210 FOREIGN KEY (roleUuid) REFERENCES user_role (uuid)');
$this->addSql('ALTER TABLE user_avatar ADD CONSTRAINT FK_73256912D73087E9 FOREIGN KEY (userUuid) REFERENCES user (uuid)');
$this->addSql('ALTER TABLE user_detail ADD CONSTRAINT FK_4B5464AED73087E9 FOREIGN KEY (userUuid) REFERENCES user (uuid)');
$this->addSql('ALTER TABLE user_remember_me ADD CONSTRAINT FK_D3E96EBDD73087E9 FOREIGN KEY (userUuid) REFERENCES user (uuid)');
$this->addSql('ALTER TABLE user_reset_password ADD CONSTRAINT FK_D21DE3BCD73087E9 FOREIGN KEY (userUuid) REFERENCES user (uuid)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user_roles DROP FOREIGN KEY FK_54FCD59FD73087E9');
$this->addSql('ALTER TABLE user_roles DROP FOREIGN KEY FK_54FCD59F88446210');
$this->addSql('ALTER TABLE user_avatar DROP FOREIGN KEY FK_73256912D73087E9');
$this->addSql('ALTER TABLE user_detail DROP FOREIGN KEY FK_4B5464AED73087E9');
$this->addSql('ALTER TABLE user_remember_me DROP FOREIGN KEY FK_D3E96EBDD73087E9');
$this->addSql('ALTER TABLE user_reset_password DROP FOREIGN KEY FK_D21DE3BCD73087E9');
$this->addSql('DROP TABLE contact_message');
$this->addSql('DROP TABLE user');
$this->addSql('DROP TABLE user_roles');
$this->addSql('DROP TABLE user_avatar');
$this->addSql('DROP TABLE user_detail');
$this->addSql('DROP TABLE user_remember_me');
$this->addSql('DROP TABLE user_reset_password');
$this->addSql('DROP TABLE user_role');
}
}
6 changes: 0 additions & 6 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.15.0@086b94371304750d1c673315321a55d15fc59015">
<file src="src/App/src/Common/UuidOrderedTimeGenerator.php">
<UndefinedInterfaceMethod>
<code>getUuidBuilder</code>
<code>setCodec</code>
</UndefinedInterfaceMethod>
</file>
<file src="src/App/src/Middleware/RememberMeMiddleware.php">
<UndefinedInterfaceMethod>
<code>getStorage</code>
Expand Down
22 changes: 0 additions & 22 deletions src/App/src/Common/TimestampAwareInterface.php

This file was deleted.

64 changes: 0 additions & 64 deletions src/App/src/Common/TimestampAwareTrait.php

This file was deleted.

12 changes: 0 additions & 12 deletions src/App/src/Common/UuidAwareInterface.php

This file was deleted.

26 changes: 0 additions & 26 deletions src/App/src/Common/UuidAwareTrait.php

This file was deleted.

29 changes: 0 additions & 29 deletions src/App/src/Common/UuidOrderedTimeGenerator.php

This file was deleted.

12 changes: 10 additions & 2 deletions src/App/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
use Dot\DependencyInjection\Factory\AttributedServiceFactory;
use Frontend\App\Controller\LanguageController;
use Frontend\App\Factory\EntityListenerResolverFactory;
Expand Down Expand Up @@ -61,9 +62,16 @@ public function getDependencies(): array
public function getDoctrineConfig(): array
{
return [
'configuration' => [
'driver' => [
'orm_default' => [
'entity_listener_resolver' => EntityListenerResolver::class,
'drivers' => [
'Frontend\App\Entity' => 'AppEntities',
],
],
'AppEntities' => [
'class' => AttributeDriver::class,
'cache' => 'array',
'paths' => [__DIR__ . '/Entity'],
],
],
];
Expand Down
Loading