<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="productdesigner_calendar" engine="innodb"  resource="default" comment="Product Designer Calendar">
        <column xsi:type="int" name="calendar_id" identity="true"  nullable="false" padding="10" unsigned="true" comment="Calendar Id" />
        <column xsi:type="varchar" name="name" nullable="false" length="255" default="" comment = "Calendar name"/>
        <column xsi:type="text" name="select_product" nullable="true" comment="Calendar Product Selection"/>
        <!--New calendar columns-->
        <column xsi:type="smallint" name="add_cover_page" padding="6" default="0" nullable="false" comment = "Add Cover Page" disabled="true"/>
        <column xsi:type="smallint" name="add_last_page" padding="6" default="0" nullable="false" comment = "Add Last Page" disabled="true"/>
        <column xsi:type="text" name="start_year" nullable="true" comment="Start calendar Year" />
        <column xsi:type="varchar" name="start_month" default="" nullable="true" length="255" comment="Start calendar Month" disabled="true" />

        <column xsi:type="varchar" name="sample_calendar_image" default="" nullable="true" length="255" comment="sample calendar image" />
        <column xsi:type="smallint" name="status" padding="6" default="0" nullable="false" comment = "Status"/>
        <column xsi:type="varchar" name="method" default="" nullable="true" length="255" comment="Select Method" />
        <column xsi:type="int" name="template_id" nullable="true" unsigned="true" comment="Template id"/>
        <column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created_at" on_update="false"/>
        <column xsi:type="timestamp" name="updated_at" nullable="true" default="CURRENT_TIMESTAMP" comment="Updated_at" on_update="true"/>
        <constraint referenceId="PRIMARY" xsi:type="primary">
            <column name="calendar_id"/>
        </constraint>
        <constraint xsi:type="foreign" referenceId="PD_TEMPLATE_ID" table="productdesigner_calendar" column="template_id" referenceTable="productdesigner_designtemplates" referenceColumn="designtemplates_id" onDelete="SET NULL"/>
    </table>
    <table name="productdesigner_calendarmedia" engine="innodb"  resource="default" comment="Product Designer Calendar Media Images">
        <column xsi:type="int" name="calendarmedia_id" identity="true"  nullable="false" padding="10" unsigned="true" comment="Calendar Media Id" />
        <column xsi:type="int" name="calendar_id" nullable="false" unsigned="true" padding="10" comment = "Calendar id"/>
        <column xsi:type="smallint" name="status" padding="6" default="0" nullable="false" comment = "Status"/>
        <column xsi:type="varchar" name="select_month" nullable="false" length="255" default="1" comment = "select month"/>
           <column xsi:type="varchar" name="select_year" nullable="false" length="255" default="" comment = "select year"/>
        <column xsi:type="varchar" name="image_path" nullable="false" length="255" default="" comment = "Image Path"/>
        <column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created_at" on_update="false"/>
        <column xsi:type="timestamp" name="updated_at" nullable="true" default="CURRENT_TIMESTAMP" comment="Updated_at" on_update="true"/>
        <constraint referenceId="PRIMARY" xsi:type="primary">
            <column name="calendarmedia_id"/>
        </constraint>
        <constraint xsi:type="foreign" referenceId="PD_CALENDAR_ID" table="productdesigner_calendarmedia" column="calendar_id" referenceTable="productdesigner_calendar" referenceColumn="calendar_id" onDelete="CASCADE"/>
    </table>
    <table name="productdesigner_predefinedholiday" engine="innodb" resource="default" comment="Product Designer Predefined Holiday">
        <column xsi:type="int" name="holiday_id" identity="true" nullable="false" unsigned="true" comment="Predefined Holiday Id"/>
        <column xsi:type="varchar" name="name" nullable="false" length="255" default="" comment="Predefined Holiday name"/>
        <column xsi:type="smallint" name="status" nullable="false" default="0" comment="Status"/>
        <column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At" on_update="false"/>
        <column xsi:type="timestamp" name="updated_at" nullable="true" default="CURRENT_TIMESTAMP" comment="Updated At" on_update="true"/>
        <constraint referenceId="PRIMARY" xsi:type="primary">
            <column name="holiday_id"/>
        </constraint>
    </table>
    <table name="productdesigner_predefinedholidaydatetime" engine="innodb" resource="default" comment="Product Designer Predefined Holiday Date and Time">
        <column xsi:type="int" name="datetime_id" identity="true" nullable="false" unsigned="true" comment="Holiday Date and Time Id"/>
        <column xsi:type="int" name="holiday_id" nullable="false" unsigned="true" comment="Holiday Id"/>
        <column xsi:type="varchar" name="name" nullable="false" length="255" default="" comment = "name"/>
        <column xsi:type="datetime" name="date" nullable="true" comment="Select Event Month Year Date"/>
        <column xsi:type="smallint" name="status" nullable="false" default="0" comment="Status"/>
        <column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At" on_update="false"/>
        <column xsi:type="timestamp" name="updated_at" nullable="true" default="CURRENT_TIMESTAMP" comment="Updated At" on_update="true"/>
        <constraint referenceId="PRIMARY" xsi:type="primary">
            <column name="datetime_id"/>
        </constraint>
        <constraint xsi:type="foreign" referenceId="PD_HOLIDAY_ID" table="productdesigner_predefinedholidaydatetime" column="holiday_id" referenceTable="productdesigner_predefinedholiday" referenceColumn="holiday_id" onDelete="CASCADE"/>
    </table>
     <!-- Calendar configuration -->
    <table name="productdesigner_config" engine="innodb" resource="default" comment="Product Designer condfiguration">
        <column xsi:type="mediumtext" name="calendar_config" nullable="true" comment="Calendar Configuration" />
    </table>
    <table name="productdesigner_designs" engine="innodb" resource="default" comment="Product Designer condfiguration">
        <column xsi:type="longtext" name="calendar_events" nullable="true" comment="Calendar holiday events" />
    </table>
      <table name="productdesigner_designtemplates" engine="innodb" resource="default" comment="Product Designer DesignTemplate">
        <column xsi:type="int" name="calendar_id" nullable="true" comment="Calendar Id" />
    </table>
</schema>