Files
2026-09-15 10:26:34 +08:00

107 lines
6.3 KiB
XML

<?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="customer_entity">
<column name="mobile" nullable="false" xsi:type="varchar" comment="Mobile" />
<column name="customer_type" nullable="false" xsi:type="int" comment="Customer Type" />
<constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_MOBILE_WEBSITE_ID">
<column name="mobile"/>
<column name="website_id"/>
</constraint>
</table>
<table name="salesperson">
<column xsi:type="int" name="salesperson_id" unsigned="true" nullable="false" identity="true"
comment="Salesperson ID"/>
<column xsi:type="varchar" name="name" nullable="false" length="255" comment="Name"/>
<column xsi:type="varchar" name="email" nullable="false" length="255" comment="Salesperson Email"/>
<column xsi:type="varchar" name="telephone" nullable="false" comment="Telephone" />
<column xsi:type="int" name="customer_id" unsigned="true" nullable="false" comment="Customer Id" />
<column xsi:type="varchar" name="rsm_email" nullable="true" length="255" comment="RSM Email"/>
<column xsi:type="varchar" name="sisr_email" nullable="true" length="255" comment="SISR Email"/>
<column xsi:type="varchar" name="csr_email" nullable="true" length="255" comment="CSR Email"/>
<column xsi:type="smallint" name="is_active" unsigned="true" nullable="false" default="1" comment="Is Active"/>
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
comment="Created At"/>
<column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
comment="Updated At"/>
<index referenceId="salesperson_name" indexType="btree">
<column name="name"/>
</index>
<index referenceId="salesperson_email" indexType="btree">
<column name="email"/>
</index>
<index referenceId="salesperson_telephone" indexType="btree">
<column name="telephone"/>
</index>
<index referenceId="customer_id" indexType="btree">
<column name="customer_id"/>
</index>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="salesperson_id"/>
</constraint>
</table>
<table name="lab">
<column xsi:type="int" name="lab_id" unsigned="true" nullable="false" identity="true"
comment="Lab ID"/>
<column xsi:type="varchar" name="lab_code" nullable="false" comment="Lab code"/>
<column xsi:type="varchar" name="booking_account" nullable="false" length="255" comment="Booking Account"/>
<column xsi:type="varchar" name="pi_sap_id" nullable="false" length="255" comment="PI SAP ID"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="true" comment="Customer Id" />
<column xsi:type="varchar" name="dealer_name" nullable="true" />
<column xsi:type="int" name="salesperson_id" unsigned="true" nullable="false" comment="Salesperson Id" />
<column xsi:type="smallint" name="is_active" unsigned="true" nullable="false" default="1" comment="Is Active"/>
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
comment="Created At"/>
<column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
comment="Updated At"/>
<index referenceId="customer_id" indexType="btree">
<column name="customer_id"/>
</index>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="lab_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="unique_lab_code">
<column name="lab_code"/>
</constraint>
</table>
<table name="avatr" resource="default" engine="innodb">
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Entity Id"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="entity_id"/>
</constraint>
<column name="name" nullable="false" xsi:type="varchar" comment="留咨人姓名" length="255"/>
<column name="telephone" nullable="false" xsi:type="varchar" comment="留咨人电话" length="12"/>
<index referenceId="AVATR_TELEPHONE" indexType="btree">
<column name="telephone"/>
</index>
<column name="favorite_vehicle" nullable="false" xsi:type="varchar" comment="意向车型代码,阿维塔11: 80951002, 阿维塔12: 80951005, 深蓝:80081004" length="255"/>
<column name="province_id" nullable="false" xsi:type="int" comment="阿维塔省市表中省对应的id" identity="false" unsigned="true"/>
<column name="city_id" nullable="false" xsi:type="int" comment="阿维塔省市表中市对应的id" identity="false" unsigned="true"/>
<column name="is_sent" nullable="true" xsi:type="boolean" comment="是否发送成功" default="0" />
<column name="response" nullable="true" xsi:type="text" comment="接口返回" />
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
comment="Created At"/>
</table>
<table name="cms_page">
<column xsi:type="varchar" name="identifier" nullable="true" length="255" comment="Page String Identifier"/>
</table>
<table name="customer_salesperson">
<column name="customer_salesperson_id" xsi:type="int" unsigned="true" nullable="false" identity="true" />
<column name="customer_id" nullable="false" xsi:type="int" unsigned="true" />
<column name="salesperson_id" nullable="false" xsi:type="int" unsigned="true" />
<constraint xsi:type="unique" referenceId="customer_salesperson_id">
<column name="customer_id"/>
<column name="salesperson_id"/>
</constraint>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="customer_salesperson_id"/>
</constraint>
</table>
</schema>