db constraint with unique remoteId if set, handle sync with tests

This commit is contained in:
2022-06-10 00:26:16 +02:00
parent f149b24802
commit c92077926e
14 changed files with 957 additions and 332 deletions

View File

@@ -38,7 +38,10 @@ use Symfony\Component\Validator\Mapping\ClassMetadata;
use function in_array;
/**
* @ORM\Table(name="chill_calendar.calendar", indexes={@ORM\Index(name="idx_calendar_remote", columns={"remoteId"})}))
* @ORM\Table(
* name="chill_calendar.calendar",
* uniqueConstraints={@ORM\UniqueConstraint(name="idx_calendar_remote", columns={"remoteId"}, options={"where": "remoteId <> ''"})}
* )
* @ORM\Entity
*/
class Calendar implements TrackCreationInterface, TrackUpdateInterface