0

There is data in my table as you can see in below image enter image description here

when i disable the extension from command line & reenable it the data is getting remove from database as i attached the picture below enter image description here

here is my database picture enter image description here

here is my db_schema.xml

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
   <table name="budd_vendor_category" resource="default" engine="innodb" comment="Vendor Category">
      <column xsi:type="smallint" name="id" padding="6" unsigned="false" nullable="false" identity="true" comment="ID" />
      <column xsi:type="varchar" name="category" nullable="false" length="50" comment="Category" />
      <column xsi:type="int" name="parent_id" nullable="false" padding="6" comment="Parent" identity="false" />
      <column xsi:type="varchar" name="description" nullable="true" length="255" comment="Descrition" />
      <column xsi:type="tinyint" name="status" padding="6" nullable="false" default="1" comment="Status" />
      <constraint xsi:type="primary" referenceId="PRIMARY">
         <column name="id" />
      </constraint>
   </table>
    <table name="marketplace_userdata" resource="default" engine="innodb">
        <column xsi:type="int" name="category_id" padding="6" unsigned="false" nullable="false" identity="false"
                 comment="Category Id"/>
    </table>
     <table name="marketplace_seller_paypal" resource="default" engine="innodb">
      <column xsi:type="smallint" name="id" padding="6" unsigned="false" nullable="false" identity="true" comment="ID" />
      <column xsi:type="varchar" name="username" nullable="false" length="50" comment="User name" />
      <column xsi:type="varchar" name="password" nullable="false" length="100" comment="password"  />
      <column xsi:type="varchar" name="signature" nullable="false" length="400" comment="Signature" />
      <column xsi:type="int" name="sellerid" nullable="false" padding="6" comment="Seller Id" />
      <constraint xsi:type="primary" referenceId="PRIMARY">
         <column name="id" />
      </constraint>
    </table>
    
     <table name="marketplace_subscription_square" resource="default" engine="innodb">
      <column xsi:type="smallint" name="id" padding="6" unsigned="false" nullable="false" identity="true" comment="ID" />
      <column xsi:type="int" name="customer_id" nullable="false" padding="6" comment="Customer id" />
      <column xsi:type="int" name="isseller" nullable="false" padding="2" comment="Is Seller"  />
      <column xsi:type="varchar" name="transaction_id" nullable="false" length="400" comment="Transaction Id" />
      <!-- <column xsi:type="varchar" name="transactionId" nullable="false" length="400" comment="Transaction Id" /> -->
      <column xsi:type="int" name="plan_id" nullable="false" padding="6" comment="Plan Id" />
       <column xsi:type="int" name="period" nullable="false" padding="6" comment="Period" />
      <column xsi:type="decimal" name="amount" nullable="false" scale="4" precision="12" default="0.0000" unsigned="false" comment="Amount" />
      <column xsi:type="timestamp" name="createAt" nullable="false"  comment="Created At" />
      <column xsi:type="varchar" name="name" nullable="false" length="100" comment="Name on card" />
      <column xsi:type="varchar" name="bussines_name" nullable="false" length="100" comment="Bussiness Name" />
      <constraint xsi:type="primary" referenceId="PRIMARY">
         <column name="id" />
      </constraint>
    </table>    
</schema>

2 Answers 2

0

Here is my db_schema.xml

<!-- Definition for the 'budd_vendor_category' table -->
<table name="budd_vendor_category" resource="default" engine="innodb" comment="Vendor Category">
    <column xsi:type="smallint" name="id" padding="6" unsigned="false" nullable="false" identity="true" comment="ID" />
    <column xsi:type="varchar" name="category" nullable="false" length="50" comment="Category" />
    <column xsi:type="int" name="parent_id" nullable="false" padding="6" comment="Parent" identity="false" />
    <column xsi:type="varchar" name="description" nullable="true" length="255" comment="Description" />
    <column xsi:type="tinyint" name="status" padding="6" nullable="false" default="1" comment="Status" />
    <constraint xsi:type="primary" referenceId="PRIMARY">
        <column name="id" />
    </constraint>
</table>

<!-- Definition for the 'marketplace_userdata' table -->
<table name="marketplace_userdata" resource="default" engine="innodb">
    <column xsi:type="int" name="category_id" padding="6" unsigned="false" nullable="false" identity="false"
        comment="Category Id"/>
</table>

<!-- Definition for the 'marketplace_seller_paypal' table -->
<table name="marketplace_seller_paypal" resource="default" engine="innodb">
    <column xsi:type="smallint" name="id" padding="6" unsigned="false" nullable="false" identity="true" comment="ID" />
    <column xsi:type="varchar" name="username" nullable="false" length="50" comment="User name" />
    <column xsi:type="varchar" name="password" nullable="false" length="100" comment="Password" />
    <column xsi:type="varchar" name="signature" nullable="false" length="400" comment="Signature" />
    <column xsi:type="int" name="sellerid" nullable="false" padding="6" comment="Seller Id" />
    <constraint xsi:type="primary" referenceId="PRIMARY">
        <column name="id" />
    </constraint>
</table>

<!-- Definition for the 'marketplace_subscription_square' table -->
<table name="marketplace_subscription_square" resource="default" engine="innodb">
    <column xsi:type="smallint" name="id" padding="6" unsigned="false" nullable="false" identity="true" comment="ID" />
    <column xsi:type="int" name="customer_id" nullable="false" padding="6" comment="Customer id" />
    <column xsi:type="int" name="isseller" nullable="false" padding="2" comment="Is Seller"  />
    <column xsi:type="varchar" name="transaction_id" nullable="false" length="400" comment="Transaction Id" />
    <column xsi:type="int" name="plan_id" nullable="false" padding="6" comment="Plan Id" />
    <column xsi:type="int" name="period" nullable="false" padding="6" comment="Period" />
    <column xsi:type="decimal" name="amount" nullable="false" scale="4" precision="12" default="0.0000" unsigned="false" comment="Amount" />
    <column xsi:type="timestamp" name="createdAt" nullable="false"  comment="Created At" />
    <column xsi:type="varchar" name="name" nullable="false" length="100" comment="Name on card" />
    <column xsi:type="varchar" name="business_name" nullable="false" length="100" comment="Business Name" />
    <constraint xsi:type="primary" referenceId="PRIMARY">
        <column name="id" />
    </constraint>
</table>
1
  • Please add a file in a question section. This is an answer section. Feb 27 at 12:21
0

DB schema removes tables after disabling the extension.

Please run the setup upgrade command with the --safe-mode=1 parameter after disabling the module. It will take a backup of the disabled module's tables.

php bin/magento setup:upgrade --safe-mode=1

Please run the setup upgrade command with the --data-restore=1 parameter after re-enabling the disabled module. It will restore the data.

php bin/magento setup:upgrade --data-restore=1

This solution works for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.