I am coding an extension for eZPublish which has an own eZPersistantObject, so it needs an own database table.
Is there any way to provide a kind of setup.php or something, which runs on extension activation and creates the table?
Thanks for your responses.
Seems like when installing extensions in your CMS you are also required to do further steps manually like doing changes to the database. See http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Installation/Extensions So I don’t think that eZPublish supports this kind of setup.
You can of course do such thing manually, like do a
CREATE TABLE IF NOT EXISTSon each request. A dirty solution: put yoursetup.phpsomewhere in your extension folder, make it writeable and after the first execution simply remove it. Just addunlink(__FILE__);at the end ofsetup.php.If you want some cleaner solution you can have a directory with database migration scripts and a table that keeps track which of those scripts have been executed. On each request you then check if there are new migration scripts and execute, if necessary.