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

<!--

 This file is part of the Sylius package.

 (c) Paweł Jędrzejewski

 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">

    <mapped-superclass name="Sylius\Component\Addressing\Model\Country" table="sylius_country">
        <id name="id" column="id" type="integer">
            <generator strategy="AUTO" />
        </id>

        <field name="isoName" column="iso_name" type="string" />
        <one-to-many field="provinces" target-entity="Sylius\Component\Addressing\Model\ProvinceInterface" mapped-by="country">
            <cascade>
                <cascade-all/>
            </cascade>
        </one-to-many>
    </mapped-superclass>

</doctrine-mapping>

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

<!--

 This file is part of the Sylius package.

 (c) Paweł Jędrzejewski

 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">

    <mapped-superclass name="Sylius\Component\Addressing\Model\Country" table="sylius_country">
        <indexes>
            <index columns="iso_name" />
        </indexes>
        <id name="id" column="id" type="integer">
            <generator strategy="AUTO" />
        </id>

        <field name="isoName" column="iso_name" type="string" length="3" />
        <one-to-many field="provinces" target-entity="Sylius\Component\Addressing\Model\ProvinceInterface" mapped-by="country">
            <cascade>
                <cascade-all/>
            </cascade>
        </one-to-many>
    </mapped-superclass>

</doctrine-mapping>

Index country on ISO code
Index country on ISO code
