Install Method and Table Creation
Posted: Fri Oct 30, 2020 8:33 am
I've having trouble creating a new table as part of a modification.
My ocmod.zip installation works fine, OCMOD modifications are run, files are moved to the correct directories. However my query to create a new database table doesn't seem to be running.
My understanding is that the way to do this is to put the query in the controller, located in: admin/controller/extension/catagory/mycontroller.php like so:
However the table is not created and nothing shows up in the error log. Any thoughts about what might be happening?
My ocmod.zip installation works fine, OCMOD modifications are run, files are moved to the correct directories. However my query to create a new database table doesn't seem to be running.
My understanding is that the way to do this is to put the query in the controller, located in: admin/controller/extension/catagory/mycontroller.php like so:
Code: Select all
class ControllerExtensionMyController extends Controller
{
private $error = array();
public function install()
{
$this->db->query("CREATE TABLE IF NOT EXISTS ... ;");
}