Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declarative schema and add index #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 0 additions & 137 deletions Setup/InstallSchema.php

This file was deleted.

31 changes: 31 additions & 0 deletions etc/db_schema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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="wuunder_shipment" resource="default" engine="innodb" comment="Wuunder Shipment Table">
<column xsi:type="int" name="shipment_id" padding="11" unsigned="true" nullable="false" identity="true" comment="Shipment ID"/>
<column xsi:type="int" name="order_id" padding="11" unsigned="true" nullable="false" comment="Order ID"/>
<column xsi:type="int" name="label_id" padding="11" unsigned="true" nullable="true" comment="Shipment Label ID"/>
<column xsi:type="text" name="label_url" nullable="true" comment="Shipment Label URL"/>
<column xsi:type="text" name="tt_url" nullable="true" comment="Shipment Track and Trace URL"/>
<column xsi:type="text" name="booking_url" nullable="true" comment="Shipment Booking URL"/>
<column xsi:type="text" name="booking_token" nullable="false" comment="Shipment Booking Token"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="shipment_id"/>
</constraint>
<index referenceId="INDEX_ORDER_ID" indexType="btree">
<column name="order_id"/>
</index>
</table>

<table name="wuunder_quote_id" resource="default" engine="innodb" comment="Wuunder Shipment Table">
<column xsi:type="int" name="id" padding="11" unsigned="true" nullable="false" identity="true" comment="ID"/>
<column xsi:type="int" name="quote_id" padding="11" unsigned="true" nullable="false" comment="Quote ID"/>
<column xsi:type="text" name="parcelshop_id" nullable="true" comment="Parcelshop ID"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="id"/>
</constraint>
</table>

<table name="sales_order">
<column xsi:type="varchar" name="wuunder_parcelshop_id" nullable="false" length="255" comment="Wuunder Parcelshop ID"/>
</table>
</schema>
34 changes: 34 additions & 0 deletions etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"wuunder_shipment": {
"column": {
"shipment_id": true,
"order_id": true,
"label_id": true,
"label_url": true,
"tt_url": true,
"booking_url": true,
"booking_token": true
},
"index": {
"WUUNDER_SHIPMENT_ORDER_ID": true
},
"constraint": {
"PRIMARY": true
}
},
"wuunder_quote_id": {
"column": {
"id": true,
"quote_id": true,
"parcelshop_id": true
},
"constraint": {
"PRIMARY": true
}
},
"sales_order": {
"column": {
"wuunder_parcelshop_id": true
}
}
}
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Wuunder_Wuunderconnector" setup_version="2.2.0" active="true">
<module name="Wuunder_Wuunderconnector" setup_version="2.2.1" active="true">
<sequence>
<module name="Magento_Checkout"/>
</sequence>
Expand Down