pkp-lib icon indicating copy to clipboard operation
pkp-lib copied to clipboard

Add a config option to set the database engine to InnoDB

Open NateWr opened this issue 4 years ago • 2 comments

Describe the problem you would like to solve Some hosting environments can not change the default storage engine of the database to InnoDB because they host over software which expects MyISAM. In such scenarios, it is not possible to run recent versions of OJS which create tables using the default storage engine.

Describe the solution you'd like Add a config option to manually specify the database engine. This config option should be added to the [database] section and commented out by default:

; Database engine
; Override this setting if you operate in a shared hosting environment and are unable to run
; OJS on the server's default database engine. 
; InnoDB is the recommended database engine for MariaDB/MySQL
; engine = InnoDB

Who is asking for this feature? Users running OJS in a shared hosting environment.

Additional information See the forum post.

NateWr avatar Sep 21 '21 08:09 NateWr

It may be possible to set the engine at the connection level, rather than needing to specify it for each table -- see: https://stackoverflow.com/questions/21380754/how-do-you-set-default-engine-for-the-schema-builder

asmecher avatar Sep 21 '21 23:09 asmecher

I successfully got all new tables to be created as InnoDB during upgrade (3.3 -> 3.4) (on a database where the default was MyISAM) by setting $engine = 'InnoDB' in this file, line 51:

\lib\pkp\lib\vendor\laravel\framework\src\Illuminate\Database\Schema\Blueprint.php

jendrage avatar Sep 10 '24 14:09 jendrage