<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="TheliaMain"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="../../../../vendor/thelia/propel/resources/xsd/database.xsd" >

    <table name="block_group" namespace="TheliaBlocks\Model">
        <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
        <column name="slug" size="50"/>
        <column defaultValue="0" name="visible" required="true" type="TINYINT" />
        <column name="title" size="255" required="true"/>
        <column name="json_content" type="LONGVARCHAR"/>
        <unique name="slug_unique">
          <unique-column name="slug" />
        </unique>
        <behavior name="timestampable" />
        <behavior name="i18n">
            <parameter name="i18n_columns" value="title, json_content" />
        </behavior>
    </table>
    <table name="item_block_group" namespace="TheliaBlocks\Model">
        <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
        <column name="item_type" type="VARCHAR" />
        <column name="item_id" type="INTEGER" />
        <column name="block_group_id" type="INTEGER" />
        <foreign-key foreignTable="block_group" name="fk_item_block_group_block_group_id" onDelete="CASCADE" onUpdate="RESTRICT">
          <reference foreign="id" local="block_group_id" />
        </foreign-key>
    </table>
</database>
