Skip to content

Commit

Permalink
[BUGFIX][IN23-251] Ported obsolete/deprecated install- and upgradesch…
Browse files Browse the repository at this point in the history
…ema to db_schema.xml and db_schema_whitelist.json.

FILE: /data/web/magento2/lib/experius/module-emailcatcher/Setup/UpgradeSchema.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | UpgradeSchema scripts are obsolete. Please use declarative schema approach in module's etc/db_schema.xml file
---------------------------------------------------------------------------------------------------------------------------

FILE: /data/web/magento2/lib/experius/module-emailcatcher/Setup/InstallSchema.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | InstallSchema scripts are obsolete. Please use declarative schema approach in module's etc/db_schema.xml file
---------------------------------------------------------------------------------------------------------------------------
  • Loading branch information
borisvankatwijk committed Oct 25, 2023
1 parent 2e84e74 commit ab23d22
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 154 deletions.
82 changes: 0 additions & 82 deletions Setup/InstallSchema.php

This file was deleted.

58 changes: 0 additions & 58 deletions Setup/UpgradeSchema.php

This file was deleted.

34 changes: 20 additions & 14 deletions etc/db_schema.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<?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="experius_emailcatcher" resource="default" engine="innodb" comment="experius_emailcatcher">
<column xsi:type="int" name="emailcatcher_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Entity ID"/>
<column xsi:type="text" name="recipient" nullable="true" comment="To Email Address"/>
<column xsi:type="text" name="sender" nullable="true" comment="From Email Address"/>
<column xsi:type="text" name="subject" nullable="true" comment="Subject"/>
<column xsi:type="text" name="body" nullable="true" comment="Email Body"/>
<column xsi:type="text" name="template_identifier" nullable="true" comment="Email Template Identifier"/>
<column xsi:type="datetime" name="created_at" on_update="false" nullable="true" comment="Created At"/>
<column xsi:type="int" name="store_id" padding="11" unsigned="false" nullable="true" identity="false" comment="Store Id"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="emailcatcher_id"/>
</constraint>
</table>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="experius_emailcatcher" resource="default" engine="innodb" comment="experius_emailcatcher">
<column xsi:type="int" name="emailcatcher_id" padding="10" unsigned="true" nullable="false" identity="true"
comment="Entity ID"/>
<column xsi:type="text" name="recipient" nullable="true" comment="To Email Address"/>
<column xsi:type="text" name="sender" nullable="true" comment="From Email Address"/>
<column xsi:type="text" name="subject" nullable="true" comment="Subject"/>
<column xsi:type="text" name="body" nullable="true" comment="Email Body"/>
<column xsi:type="text" name="template_identifier" nullable="true" comment="Email Template Identifier"/>
<column xsi:type="datetime" name="created_at" on_update="false" nullable="true" comment="Created At"/>
<column xsi:type="int" name="store_id" padding="11" unsigned="false" nullable="true" identity="false"
comment="Store Id"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="emailcatcher_id"/>
<column name="emailcatcher_id"/>
</constraint>
<column xsi:type="text" name="to" nullable="true" comment="To Email Address"/>
<column xsi:type="text" name="from" nullable="true" comment="From Email Address"/>
</table>
</schema>
19 changes: 19 additions & 0 deletions etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"experius_emailcatcher": {
"column": {
"emailcatcher_id": true,
"recipient": true,
"sender": true,
"subject": true,
"body": true,
"template_identifier": true,
"created_at": true,
"store_id": true,
"to": true,
"from": true
},
"constraint": {
"PRIMARY": true
}
}
}

0 comments on commit ab23d22

Please sign in to comment.