[backend] from mariadb to postgres

This commit is contained in:
2025-10-20 13:50:56 +02:00
parent 49733e03b7
commit c334452426
69 changed files with 1082 additions and 1506 deletions
@@ -11,17 +11,12 @@
<id name="id" type="article_id">
<generator strategy="NONE" />
</id>
<indexes>
<index fields="hash" />
<index fields="publishedAt" />
<index name="IDX_PUBLISHED_AT_ID" fields="publishedAt, id" />
</indexes>
<field name="title" length="1024" />
<field name="body" type="text" />
<embedded name="link" class="Basango\Aggregator\Domain\Model\ValueObject\Link" use-column-prefix="false" />
<field name="hash" length="32" />
<field name="categories" nullable="true" />
<field name="categories" type="text[]" nullable="true" />
<many-to-one field="source" target-entity="Basango\Aggregator\Domain\Model\Entity\Source">
<join-column nullable="false" on-delete="CASCADE" />
@@ -39,13 +34,13 @@
<field name="image"
insertable="false"
updatable="false"
column-definition="VARCHAR(1024) GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(metadata, '$.image'))) STORED"
column-definition="VARCHAR(1024) GENERATED ALWAYS AS ((metadata->>'image')) STORED"
/>
<field
name="excerpt"
insertable="false"
updatable="false"
column-definition="VARCHAR(255) GENERATED ALWAYS AS (CONCAT(LEFT(body, 200), '...')) STORED"
column-definition="VARCHAR(255) GENERATED ALWAYS AS ((left(body, 200) || '...')) STORED"
/>
<field name="publishedAt" type="datetime_immutable" />
@@ -13,7 +13,7 @@
</id>
<field name="url" />
<field name="name" unique="true" />
<field name="name" />
<embedded name="credibility" class="Basango\Aggregator\Domain\Model\ValueObject\Scoring\Credibility" use-column-prefix="false" />
<field name="displayName" nullable="true" />
@@ -12,7 +12,6 @@
<generator strategy="NONE"/>
</id>
<!-- fetching eager cause will always need to check the user's id whenever we deal with a bookmark -->
<many-to-one field="user" target-entity="Basango\IdentityAndAccess\Domain\Model\Entity\User" fetch="EAGER">
<join-column nullable="false" on-delete="CASCADE" />
</many-to-one>
@@ -16,7 +16,7 @@
<join-column nullable="false" on-delete="CASCADE" />
</many-to-one>
<field name="ipAddress" nullable="true" length="15" />
<field name="ipAddress" type="inet" nullable="true" length="15" />
<embedded name="device" class="Basango\SharedKernel\Domain\Model\ValueObject\Tracking\Device" />
<embedded name="location" class="Basango\SharedKernel\Domain\Model\ValueObject\Tracking\GeoLocation" />
@@ -15,19 +15,19 @@
<field name="name"/>
<field name="email" type="email" />
<field name="password" length="512" />
<embedded name="roles" class="Basango\IdentityAndAccess\Domain\Model\ValueObject\Roles" use-column-prefix="false" />
<field name="isLocked" type="boolean">
<options>
<option name="default">0</option>
<option name="default">false</option>
</options>
</field>
<field name="isConfirmed" type="boolean">
<options>
<option name="default">0</option>
<option name="default">false</option>
</options>
</field>
<embedded name="roles" class="Basango\IdentityAndAccess\Domain\Model\ValueObject\Roles" use-column-prefix="false" />
<field name="createdAt" type="datetime_immutable" />
<field name="updatedAt" type="datetime_immutable" nullable="true" />
</entity>
@@ -5,6 +5,6 @@
https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<embeddable name="Basango\IdentityAndAccess\Domain\Model\ValueObject\Roles">
<field name="roles" type="json"/>
<field name="roles" type="jsonb"/>
</embeddable>
</doctrine-mapping>
@@ -10,7 +10,7 @@
<field name="device" type="string" nullable="true" />
<field name="isBot" type="boolean" nullable="false" >
<options>
<option name="default">0</option>
<option name="default">false</option>
</options>
</field>
</embeddable>