<commit_before><?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) <NAME>

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">

    <mapped-superclass name="Sylius\Component\Taxation\Model\TaxCategory" table="sylius_tax_category">
        <id name="id" column="id" type="integer">
            <generator strategy="AUTO" />
        </id>

        <field name="code" column="code" type="string" unique="true" />
        <field name="name" column="name" type="string" />
        <field name="description" column="description" type="text" nullable="true" />

        <one-to-many field="rates" target-entity="Sylius\Component\Taxation\Model\TaxRateInterface" mapped-by="category">
            <cascade>
                <cascade-all/>
            </cascade>
        </one-to-many>

        <field name="createdAt" column="created_at" type="datetime">
            <gedmo:timestampable on="create"/>
        </field>
        <field name="updatedAt" column="updated_at" type="datetime" nullable="true">
            <gedmo:timestampable on="update"/>
        </field>
    </mapped-superclass>

</doctrine-mapping>
<commit_msg>Make sure doctrine removes orphan tax rates, because tax rates category is not nullable.<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) <NAME>

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">

    <mapped-superclass name="Sylius\Component\Taxation\Model\TaxCategory" table="sylius_tax_category">
        <id name="id" column="id" type="integer">
            <generator strategy="AUTO" />
        </id>

        <field name="code" column="code" type="string" unique="true" />
        <field name="name" column="name" type="string" />
        <field name="description" column="description" type="text" nullable="true" />

        <one-to-many field="rates" target-entity="Sylius\Component\Taxation\Model\TaxRateInterface" mapped-by="category"
            orphan-removal="true">
            <cascade>
                <cascade-all/>
            </cascade>
        </one-to-many>

        <field name="createdAt" column="created_at" type="datetime">
            <gedmo:timestampable on="create"/>
        </field>
        <field name="updatedAt" column="updated_at" type="datetime" nullable="true">
            <gedmo:timestampable on="update"/>
        </field>
    </mapped-superclass>

</doctrine-mapping>

{'fraction_non_alphanumeric': 0.1504937010554988, 'fraction_numerical': 0.0020429009193054137, 'mean_word_length': 3.00818553888131, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 2, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1698622', 'n_tokens_mistral': 874, 'n_tokens_neox': 847, 'n_words': 182}