EasyAdminBundle
EasyAdminBundle copied to clipboard
Allow composite PKs, or a unique key that isn't PK
Short description of what this feature will allow to do:
I'm new to postgres partitions, but as I understand it the partitions require a composite PK, where one part is the differentiation column.
Example of how to use this feature
But I want to continue to use EasyAdmin (with pretty routes).
I think having a way to have a unique column that is used for lookup world work. This is how API Platform works
#[ORM\Entity(repositoryClass: InstRepository::class)]
#[ORM\Table(name: 'inst')]
#[ORM\Id] #[ORM\Column(name: 'aggregator_code', type: Types::STRING, length: 32)]
#[Groups(['inst.read'])] public string $aggregatorCode;
#[ORM\Id] #[ORM\Column(name: 'source_id', type: Types::STRING, length: 255)]
#[Groups(['inst.read'])] public string $sourceId;
// (remove the bigserial id entirely)
#[ApiProperty(identifier: true)]
#[ORM\Column(name: 'source_id', type: Types::STRING, length: 255)]
// set to $this->aggregatorCode . ':' . $this->sourceId;
Perhaps there's another way to do this already?