0

This should be a pretty easy question for most but i'm pretty bad with mysql.

I did a select and i see that i need to remove a module schema version and data version but i don't know the exact delete statement.

Database changed
MariaDB [main]> Select * FROM module_setup;
ERROR 1146 (42S02): Table 'main.module_setup' doesn't exist
MariaDB [main]> Select * FROM setup_module;
+---------------------------------+----------------+--------------+
| module                          | schema_version | data_version |
+---------------------------------+----------------+--------------+
| Aheadworks_Ctq                  | 1.4.0          | 1.4.0        |
| Aheadworks_Sbp                  | 1.2.3          | 1.2.3        |
| Amazon_Core                     | 4.0.4          | 4.0.4        |
| Amazon_Login                    | 4.0.4          | 4.0.4        |
| Amazon_Payment                  | 4.0.4          | 4.0.4        |
| Bss_DeleteOrder                 | 1.0.6          | 1.0.6        |
| Dotdigitalgroup_Chat            | 1.2.0          | 1.2.0        |
| Dotdigitalgroup_Email           | 4.8.0          | 4.8.0        |
| Dotdigitalgroup_Enterprise      | 1.2.0          | 1.2.0     

Can somebody assist me with the delete statement to remove the data version and schema version? thanks in advance.

1
  • Do you want to remove the schema_version and data_version columns or just some specific values? Commented Aug 22, 2022 at 5:16

1 Answer 1

0

If you want to delete both of these columns then use the following command. (Keep in mind that this will delete these columns from the table, which can cause issues when you install new modules.)

ALTER TABLE setup_module DROP schema_version;
ALTER TABLE setup_module DROP data_version;

But if you want to delete some values from these columns then implement the following command.

DELETE FROM setup_module
WHERE schema_version = some_value;

Same for the other column.

2
  • Thanks for your answer on this question. I only want to delete from one module. For instance, this one: Bss_DeleteOrder | 1.0.6 | 1.0.6 |.. I don't want to delete all of them. @Muhammad Muiz Ather
    – Head
    Commented Aug 22, 2022 at 14:34
  • 1
    You can do DELETE FROM setup_module WHERE module = Bss_DeleteOrder. It will delete the row of that module. Commented Aug 23, 2022 at 5:34

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.