pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
304 stars 444 forks source link

Add a config option to set the database engine to InnoDB #7311

Open NateWr opened 3 years ago

NateWr commented 3 years ago

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.

asmecher commented 3 years ago

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

jendrage commented 1 month ago

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