-
- 74 Posts
I did not create those tables. I will later reorganize that DB but it seems I won’t be able to use modx xpdo to migrate data from the old tables to the new ones !
Sure you can, just don’t create a class for it. Use the PDO features to directly access that table and you’ll be fine. You just have to have a primary key to do any object/relational mappings.
-
- 74 Posts
No, as I don’t know anything about PDO/xPDO !
But I *will* have to learn if I want to end this project.
-
- 64 Posts
Hi Bob,
do you have any idea what could be the reason for the problem that the "Create Xpdo Classes"-script doesn´t work in our system anymore.
I added a new column to a table of a database and run the script but cannot read values of the new column while reading the neighbour-columns is no problem at all.
Maybe a cache-issue?
What do you normally recommend in such cases to check first? What are typically reasons when this technique fails?
-
- 24,544 Posts
Did you add the field to your schema and then run the script to generate the class and map files? MODX ignores the schema, so any time it changes, you have to regenerate the class and map files.
Manually deleting all files in the core/cache directory will make sure it's not a cache issue.
-
- 64 Posts
Hi Bob, do you mean by "add field to your schema" the prefix of the table? Beside the prefix we altered nothing else before running the script.
Does this mean we forgot anything/did something wrong?
-
- 24,544 Posts
If you add a new field to the database table and you want to use it with MODX/xPDO, you need to add that field to your schema and run the script again to re-generate the class and map files. Otherwise, MODX has no way of knowing that the field exists in that object.