Open JayCarney opened 7 years ago
Hi Jay, Take a look at this page.
Offhand, I'd say the way to integrate that into a package would be create the empty table locally and use the script at the link above to create the schema and class and map files. Then put the class and map files in the core/model/ folder of your package.
Use a prefix on the table name, but not the same one used in the MODX db. You will have to specify your prefix when accessing the table in MODX.
That still doesn't import the empty table.
This very elegant code of Mark Hamstra's will create the tables from the class and map files. Just replace 'versionx' with the name of your project, and replace the class names with the name(s) of your class(es).
Pretty new to MODX schema's in general, just trying to find an example for adding a custom database table as part of MyComponent.
Essentially looking for a workflow for creating tables & schemas then packaging them as part of the extra, reading tutorials on the MODX just leaves me scratching my head on how this all comes together with MyComponent