<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
  <table name="mageplaza_custom_form_form" resource="default" engine="innodb" comment="Custom Form Table">
    <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Form ID"/>
    <column xsi:type="varchar" name="name" nullable="false" length="255" comment="Form Name"/>
    <column xsi:type="text" name="identifier" nullable="true" comment="Identifier"/>
    <column xsi:type="int" name="status" padding="11" unsigned="false" nullable="false" identity="false" comment="Status"/>
    <column xsi:type="varchar" name="store_ids" nullable="true" length="255" comment="Stores"/>
    <column xsi:type="varchar" name="customer_group_ids" nullable="true" length="255" comment="Customer Groups"/>
    <column xsi:type="timestamp" name="valid_from_date" on_update="false" nullable="true" comment="Valid From Date"/>
    <column xsi:type="timestamp" name="valid_to_date" on_update="false" nullable="true" comment="Valid To Date"/>
    <column xsi:type="varchar" name="form_style" nullable="true" length="255" comment="Form Style"/>
    <column xsi:type="varchar" name="fb_button_text" nullable="true" length="255" comment="Form Style"/>
    <column xsi:type="varchar" name="popup_type" nullable="true" length="10" comment="Popup Type"/>
    <column xsi:type="mediumtext" name="custom_css" nullable="true" comment="Custom CSS"/>
    <column xsi:type="varchar" name="action_after_submit" nullable="true" length="10" comment="Action After Submit Form"/>
    <column xsi:type="varchar" name="page_url" nullable="true" length="255" comment="Action After Submit URL"/>
    <column xsi:type="varchar" name="cms_page" nullable="true" length="255" comment="Action After Submit Cms Page"/>
    <column xsi:type="mediumtext" name="custom_form" nullable="true" comment="Custom Form"/>
    <column xsi:type="int" name="admin_nof_enabled" padding="11" unsigned="false" nullable="true" identity="false" comment="Admin Notification Enable"/>
    <column xsi:type="text" name="admin_nof_send_to" nullable="true" comment="Admin Notification Send To"/>
    <column xsi:type="varchar" name="admin_nof_send_time" nullable="true" length="20" comment="Admin Notification Send Time"/>
    <column xsi:type="varchar" name="admin_nof_sender" nullable="true" length="225" comment="Admin Notification Sender"/>
    <column xsi:type="varchar" name="admin_nof_template" nullable="true" length="225" comment="Admin Notification Email Template"/>
    <column xsi:type="int" name="auto_res_enabled" padding="11" unsigned="false" nullable="true" identity="false" comment="Auto-responder Enable"/>
    <column xsi:type="varchar" name="auto_res_email_address" nullable="true" length="255" comment="Auto-responder Email address field"/>
    <column xsi:type="varchar" name="auto_res_sender" nullable="true" length="225" comment="Auto-responder Sender"/>
    <column xsi:type="varchar" name="auto_res_template" nullable="true" length="225" comment="Auto-responder Email Template"/>
    <column xsi:type="mediumtext" name="email_planing" nullable="true" comment="Auto-responder Email planing"/>
    <column xsi:type="mediumtext" name="responses_summary" nullable="true" comment="Response Summary"/>
    <column xsi:type="timestamp" name="last_responses_update" on_update="false" nullable="true" comment="Last Time Updated Response Summary"/>
    <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Updated At"/>
    <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true" comment="Created At"/>
    <column xsi:type="int" name="views" padding="11" unsigned="false" nullable="true" identity="false" default="0" comment="Views"/>
    <column xsi:type="text" name="admin_nof_cc_to_email" nullable="true" comment="Admin Notification CC To Email"/>
    <column xsi:type="text" name="admin_nof_bcc_to_email" nullable="true" comment="Admin Notification BCC To Email"/>
    <column xsi:type="int" name="admin_nof_attached_files" padding="11" unsigned="false" nullable="true" identity="false" comment="Admin Notification Attached Files"/>
    <column xsi:type="int" name="auto_res_attached_files" padding="11" unsigned="false" nullable="true" identity="false" comment="Auto-responder Attached Files"/>
    <constraint xsi:type="primary" referenceId="PRIMARY">
      <column name="id"/>
    </constraint>
    <index referenceId="MAGEPLAZA_CUSTOM_FORM_FORM_ID" indexType="btree">
      <column name="id"/>
    </index>
  </table>
  <table name="mageplaza_custom_form_responses" resource="default" engine="innodb" comment="Custom Form Responses Table">
    <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="Form ID"/>
    <column xsi:type="int" name="form_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Form Id"/>
    <column xsi:type="int" name="customer_id" padding="11" unsigned="false" nullable="true" identity="false" comment="Customer Id"/>
    <column xsi:type="int" name="store_ids" padding="11" unsigned="false" nullable="true" identity="false" comment="Store Id"/>
    <column xsi:type="varchar" name="store_name" nullable="true" length="255" comment="Store Name"/>
    <column xsi:type="varchar" name="ip_address" nullable="true" length="255" comment="IP Address"/>
    <column xsi:type="mediumtext" name="form_data" nullable="true" comment="Form Data"/>
    <column xsi:type="int" name="is_complete" padding="11" unsigned="false" nullable="false" identity="false" default="0" comment="Is Email Planing Completed"/>
    <column xsi:type="int" name="admin_nof" padding="11" unsigned="false" nullable="false" identity="false" default="0" comment="Admin Notification"/>
    <column xsi:type="mediumtext" name="email_planing" nullable="true" comment="Email Planing"/>
    <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true" comment="Created At"/>
    <constraint xsi:type="primary" referenceId="PRIMARY">
      <column name="id"/>
    </constraint>
    <constraint xsi:type="foreign" referenceId="FK_322F5E46385A2A37E4DEA6AC4499E7DF" table="mageplaza_custom_form_responses" column="form_id" referenceTable="mageplaza_custom_form_form" referenceColumn="id" onDelete="CASCADE"/>
    <index referenceId="MAGEPLAZA_CUSTOM_FORM_RESPONSES_ID" indexType="btree">
      <column name="id"/>
    </index>
  </table>
</schema>
