Skip to content

Commit 09bd57a

Browse files
committed
Remove obsolete metadata fields from version tables
Signed-off-by: Tim Goudriaan <tim@codedmonkey.com>
1 parent a27935d commit 09bd57a

10 files changed

Lines changed: 405 additions & 247 deletions

migrations/Version20260126160137.php

Lines changed: 404 additions & 0 deletions
Large diffs are not rendered by default.

src/Doctrine/Entity/AbstractVersionLink.php

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/Doctrine/Entity/Keyword.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
namespace CodedMonkey\Dirigent\Doctrine\Entity;
44

55
use CodedMonkey\Dirigent\Doctrine\Repository\KeywordRepository;
6-
use Doctrine\Common\Collections\ArrayCollection;
7-
use Doctrine\Common\Collections\Collection;
86
use Doctrine\ORM\Mapping as ORM;
97

108
#[ORM\Entity(repositoryClass: KeywordRepository::class)]
@@ -19,17 +17,9 @@ class Keyword
1917
#[ORM\Column(length: 191)]
2018
private string $name;
2119

22-
#[ORM\ManyToMany(targetEntity: Version::class, mappedBy: 'keywords')]
23-
protected Collection $versions;
24-
25-
#[ORM\ManyToMany(targetEntity: Metadata::class, mappedBy: 'keywords')]
26-
protected Collection $metadata;
27-
2820
public function __construct(string $name)
2921
{
3022
$this->name = $name;
31-
$this->versions = new ArrayCollection();
32-
$this->metadata = new ArrayCollection();
3323
}
3424

3525
public function getId(): ?int

src/Doctrine/Entity/Version.php

Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use CodedMonkey\Dirigent\Doctrine\Repository\VersionRepository;
66
use Doctrine\Common\Collections\ArrayCollection;
77
use Doctrine\Common\Collections\Collection;
8-
use Doctrine\DBAL\Types\Types;
98
use Doctrine\ORM\Mapping as ORM;
109

1110
#[ORM\Entity(repositoryClass: VersionRepository::class)]
@@ -18,102 +17,21 @@ class Version extends TrackedEntity
1817
#[ORM\GeneratedValue]
1918
private ?int $id = null;
2019

21-
#[ORM\Column]
22-
protected string $packageName;
23-
2420
#[ORM\Column]
2521
private string $name;
2622

2723
#[ORM\Column(length: 191)]
2824
private string $normalizedName;
2925

30-
#[ORM\Column(type: Types::TEXT, nullable: true)]
31-
protected ?string $description = null;
32-
33-
#[ORM\Column(type: Types::TEXT, nullable: true)]
34-
protected ?string $readme = null;
35-
36-
#[ORM\Column(nullable: true)]
37-
protected ?string $homepage = null;
38-
3926
#[ORM\Column]
4027
private bool $development;
4128

42-
#[ORM\Column]
43-
protected array $license = [];
44-
45-
#[ORM\Column(nullable: true)]
46-
protected ?string $type = null;
47-
48-
#[ORM\Column(nullable: true)]
49-
protected ?string $targetDir = null;
50-
51-
#[ORM\Column(nullable: true)]
52-
protected ?array $source = null;
53-
54-
#[ORM\Column(nullable: true)]
55-
protected ?array $dist = null;
56-
57-
#[ORM\OneToMany(mappedBy: 'version', targetEntity: VersionRequireLink::class, cascade: ['persist', 'detach', 'remove'])]
58-
protected Collection $require;
59-
60-
#[ORM\OneToMany(mappedBy: 'version', targetEntity: VersionDevRequireLink::class, cascade: ['persist', 'detach', 'remove'])]
61-
protected Collection $devRequire;
62-
63-
#[ORM\OneToMany(mappedBy: 'version', targetEntity: VersionConflictLink::class, cascade: ['persist', 'detach', 'remove'])]
64-
protected Collection $conflict;
65-
66-
#[ORM\OneToMany(mappedBy: 'version', targetEntity: VersionProvideLink::class, cascade: ['persist', 'detach', 'remove'])]
67-
protected Collection $provide;
68-
69-
#[ORM\OneToMany(mappedBy: 'version', targetEntity: VersionReplaceLink::class, cascade: ['persist', 'detach', 'remove'])]
70-
protected Collection $replace;
71-
72-
#[ORM\OneToMany(mappedBy: 'version', targetEntity: VersionSuggestLink::class, cascade: ['persist', 'detach', 'remove'])]
73-
protected Collection $suggest;
74-
75-
#[ORM\ManyToMany(targetEntity: Keyword::class, inversedBy: 'versions', cascade: ['persist', 'detach', 'remove'])]
76-
protected Collection $keywords;
77-
78-
#[ORM\Column]
79-
protected array $autoload = [];
80-
81-
/**
82-
* @var string[]|null
83-
*/
84-
#[ORM\Column(nullable: true)]
85-
protected ?array $binaries = null;
86-
87-
/**
88-
* @var string[]|null
89-
*/
90-
#[ORM\Column(nullable: true)]
91-
protected ?array $includePaths = null;
92-
93-
#[ORM\Column(nullable: true)]
94-
protected ?array $phpExt = null;
95-
96-
#[ORM\Column(nullable: true)]
97-
protected ?array $authors = null;
98-
99-
#[ORM\Column(nullable: true)]
100-
protected ?array $support = null;
101-
102-
#[ORM\Column(nullable: true)]
103-
protected ?array $funding = null;
104-
105-
#[ORM\Column(nullable: true)]
106-
protected ?array $extra = null;
107-
10829
#[ORM\Column]
10930
private bool $defaultBranch = false;
11031

11132
#[ORM\Column(nullable: true)]
11233
private ?\DateTimeImmutable $updatedAt = null;
11334

114-
#[ORM\Column(nullable: true)]
115-
protected ?\DateTimeImmutable $releasedAt = null;
116-
11735
#[ORM\ManyToOne(targetEntity: Package::class, inversedBy: 'versions')]
11836
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
11937
private Package $package;
@@ -130,15 +48,7 @@ class Version extends TrackedEntity
13048
public function __construct(Package $package)
13149
{
13250
$this->package = $package;
133-
$this->packageName = $package->getName();
134-
135-
$this->require = new ArrayCollection();
136-
$this->devRequire = new ArrayCollection();
137-
$this->conflict = new ArrayCollection();
138-
$this->provide = new ArrayCollection();
139-
$this->replace = new ArrayCollection();
140-
$this->suggest = new ArrayCollection();
141-
$this->keywords = new ArrayCollection();
51+
14252
$this->installations = new VersionInstallations($this);
14353
$this->metadata = new ArrayCollection();
14454
}

src/Doctrine/Entity/VersionConflictLink.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Doctrine/Entity/VersionDevRequireLink.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Doctrine/Entity/VersionProvideLink.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Doctrine/Entity/VersionReplaceLink.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Doctrine/Entity/VersionRequireLink.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Doctrine/Entity/VersionSuggestLink.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)