mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-27 04:32:14 +00:00
Added checks to use MyISAM if MySQL 5.5 is found
This commit is contained in:
parent
5942d796b5
commit
1bec3eaa1e
@ -12,8 +12,13 @@ class CreateBooksTable extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('books', function (Blueprint $table) {
|
$pdo = \DB::connection()->getPdo();
|
||||||
$table->engine = 'MyISAM';
|
$mysqlVersion = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||||
|
$requiresISAM = strpos($mysqlVersion, '5.5') === 0;
|
||||||
|
|
||||||
|
Schema::create('books', function (Blueprint $table) use ($requiresISAM) {
|
||||||
|
if($requiresISAM) $table->engine = 'MyISAM';
|
||||||
|
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('slug')->indexed();
|
$table->string('slug')->indexed();
|
||||||
|
@ -12,8 +12,13 @@ class CreatePagesTable extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('pages', function (Blueprint $table) {
|
$pdo = \DB::connection()->getPdo();
|
||||||
$table->engine = 'MyISAM';
|
$mysqlVersion = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||||
|
$requiresISAM = strpos($mysqlVersion, '5.5') === 0;
|
||||||
|
|
||||||
|
Schema::create('pages', function (Blueprint $table) use ($requiresISAM) {
|
||||||
|
if($requiresISAM) $table->engine = 'MyISAM';
|
||||||
|
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('book_id');
|
$table->integer('book_id');
|
||||||
$table->integer('chapter_id');
|
$table->integer('chapter_id');
|
||||||
|
@ -12,8 +12,12 @@ class CreateChaptersTable extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('chapters', function (Blueprint $table) {
|
$pdo = \DB::connection()->getPdo();
|
||||||
$table->engine = 'MyISAM';
|
$mysqlVersion = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||||
|
$requiresISAM = strpos($mysqlVersion, '5.5') === 0;
|
||||||
|
|
||||||
|
Schema::create('chapters', function (Blueprint $table) use ($requiresISAM) {
|
||||||
|
if($requiresISAM) $table->engine = 'MyISAM';
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('book_id');
|
$table->integer('book_id');
|
||||||
$table->string('slug')->indexed();
|
$table->string('slug')->indexed();
|
||||||
|
Loading…
Reference in New Issue
Block a user