Challenges with Module Modification and Table Deletion in Corteza: A Closer Look at Field Addition and Database Cleanup

In the current version of Corteza, there is no support for altering the physical table created to store records. For instance, I use “{{namespace}}-{{module}}” for the “Collection or database table name” in the module, and I also use “encode values into Column” for all data and save it. After correctly saving this module, when you want to modify the module and add a new field, it only allows you to add a new field by type JSON. It lets you save, but if you don’t have any JSON field in the original generation, it causes an issue when you want to add data in this module because, in reality, any JSON field does not exist in the DB table. The module cannot be modified to add a field, but Corteza allows it.

Another problem arises when you save the module with a special Collection or database table name, meaning creating a new table in the database to save record values. If you delete that module due to an error and need to create it again with the same name (handle), the physical table still exists because Corteza does not delete it when you delete the module, causing further issues.

I need to know if this problem exists in the current version (so I must avoid using the Column) or if I have misunderstood. I would appreciate your help with this issue.

Hi @aaz , thanks for this, we are aware, but we do not have an issue for this yet.
Would you be willing to create one, with as much info as possible?

One way to enable this is to set the DAL settings in the compose_module table manually by yourself and restarting the server. For now.

Thanks

1 Like

@peter don’t you think it could be related to deleted modules not being cleaned up and causing trouble exporting namespaces, as referenced in here and here?

@ege345dc4g5c45gc not likely, as those exports suffer from orphan links to resources (module linking to a deleted module, charts config linking to a deleted module, etc).

i try to export a namespace but i get this error, in my case is it an issue with a page linking to a deleted module ?
{ "error":{ "message":"parent reference {corteza::compose:page {[347533949125320707] map[347533949125320707:true]} {corteza::compose:namespace {[344241087105269762] map[344241087105269762:true]}} false} not found" } }