From acd1d69df864c9a5a52ce37c4f2225c4a3551e39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Fri, 10 Nov 2023 13:29:02 +0100 Subject: [PATCH] Remove language relation Set nullable slug Add locale field Add preUpdate callback --- .../doctrine/KeywordTranslation.orm.yml | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Resources/config/doctrine/KeywordTranslation.orm.yml b/Resources/config/doctrine/KeywordTranslation.orm.yml index 0ba4b8b..18cf06e 100644 --- a/Resources/config/doctrine/KeywordTranslation.orm.yml +++ b/Resources/config/doctrine/KeywordTranslation.orm.yml @@ -7,19 +7,21 @@ Rapsys\BlogBundle\Entity\KeywordTranslation: type: integer options: unsigned: true - language_id: - type: smallint - options: - unsigned: true + locale: + type: string + length: 5 fields: + description: + type: text + nullable: true slug: type: string length: 128 + nullable: true title: type: string length: 128 - description: - type: text + nullable: true created: type: datetime updated: @@ -28,9 +30,10 @@ Rapsys\BlogBundle\Entity\KeywordTranslation: keyword: targetEntity: Rapsys\BlogBundle\Entity\Keyword inversedBy: keyword_translations - language: - targetEntity: Rapsys\BlogBundle\Entity\Language - inversedBy: keyword_translations + joinColumn: + nullable: false uniqueConstraints: - slug_language: - columns: [ slug, language_id ] + locale_slug: + columns: [ locale, slug ] + lifecycleCallbacks: + preUpdate: ['preUpdate'] -- 2.41.1