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

    <table name="pdr_places" namespace="PointRetrait\Model">
        <column name="id" autoIncrement="true" primaryKey="true" required="true" type="INTEGER" />
        <column name="title" required="true" size="50" type="VARCHAR" />
        <column name="active" required="true" type="TINYINT" defaultValue="1" />
        <column name="price" required="true" type="FLOAT" defaultValue="0" />
        <column name="minimum_amount" required="true" type="FLOAT" defaultValue="0" />
        <column name="latitude" required="false" type="DOUBLE" />
        <column name="longitude" required="false" type="DOUBLE" />
        <column name="address1" size="255" type="VARCHAR" required="true"/>
        <column name="address2" size="255" type="VARCHAR"/>
        <column name="address3" size="255" type="VARCHAR"/>
        <column name="zipcode" required="true" size="10" type="VARCHAR"/>
        <column name="city" required="true" size="255" type="VARCHAR"/>
    </table>


    <table name="pdr_schedule" namespace="PointRetrait\Model">
        <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
        <column name="id_place" required="true" type="INTEGER" />
        <column name="day" required="true" type="INTEGER" />
        <column name="begin_time" required="true" type="TIME" />
        <column name="end_time" required="true" type="TIME" />

        <foreign-key foreignTable="pdr_places" name="fk_places_schedule" onDelete="CASCADE">
            <reference foreign="id" local="id_place"/>
        </foreign-key>
    </table>


</database>
