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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ jobs:
run: composer validate --no-check-all --no-check-lock --strict;
- name: Linting all php files
run: find src/ tests/ public/ -name ''*.php'' -print0 | xargs -0 -n 1 -P 4 php -l; php -l bin/*;
- name: Validate Doctrine schema
run: |
export PHPLIST_DATABASE_NAME=${{ env.DB_DATABASE }}
export PHPLIST_DATABASE_USER=${{ env.DB_USERNAME }}
export PHPLIST_DATABASE_PASSWORD=${{ env.DB_PASSWORD }}
export PHPLIST_DATABASE_PORT=${{ job.services.mysql.ports['3306'] }}
export PHPLIST_DATABASE_HOST=127.0.0.1
php bin/console doctrine:schema:validate --skip-sync
- name: Run units tests with phpunit
run: vendor/bin/phpunit tests/Unit/ --testdox
- name: Run integration tests with phpunit
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Identity/Model/AdminAttributeValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class AdminAttributeValue implements DomainModel
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: AdminAttributeDefinition::class)]
#[ORM\ManyToOne(targetEntity: AdminAttributeDefinition::class, inversedBy: 'attributeValues')]
#[ORM\JoinColumn(name: 'adminattributeid', referencedColumnName: 'id')]
private AdminAttributeDefinition $attributeDefinition;

Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Subscription/Model/SubscriberList.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SubscriberList implements DomainModel, Identity, CreationDate, Modificatio
#[ORM\Column]
private ?string $category = '';

#[ORM\ManyToOne(targetEntity: Administrator::class)]
#[ORM\ManyToOne(targetEntity: Administrator::class, inversedBy: 'ownedLists')]
#[ORM\JoinColumn(name: 'owner')]
private ?Administrator $owner = null;

Expand Down
13 changes: 13 additions & 0 deletions src/Migrations/Version20251028092901MySqlInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ public function up(Schema $schema): void
get_class($platform)
)
);

$schemaManager = $this->connection->createSchemaManager();
$tables = $schemaManager->listTableNames();
$hasUserStats = array_filter(
$tables,
static fn (string $table): bool =>
str_ends_with($table, 'userstats')
);
$this->skipIf(
!empty($hasUserStats),
'phpList schema already exists.'
);
Comment thread
TatevikGr marked this conversation as resolved.

// this up() migration is auto-generated, please modify it to your needs
$this->addSql(file_get_contents(__DIR__.'/initial_schema.sql'));
}
Expand Down
Loading