Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-06-04 16:32:57 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
1bec3eaa1e314c6382c034602f4d6027e02908af
1bec3eaa
1 parent
5942d796
Added checks to use MyISAM if MySQL 5.5 is found
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
database/migrations/2015_07_12_114933_create_books_table.php
database/migrations/2015_07_12_190027_create_pages_table.php
database/migrations/2015_07_27_172342_create_chapters_table.php
database/migrations/2015_07_12_114933_create_books_table.php
View file @
1bec3ea
...
...
@@ -12,8 +12,13 @@ class CreateBooksTable extends Migration
*/
public
function
up
()
{
Schema
::
create
(
'books'
,
function
(
Blueprint
$table
)
{
$table
->
engine
=
'MyISAM'
;
$pdo
=
\DB
::
connection
()
->
getPdo
();
$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
->
string
(
'name'
);
$table
->
string
(
'slug'
)
->
indexed
();
...
...
database/migrations/2015_07_12_190027_create_pages_table.php
View file @
1bec3ea
...
...
@@ -12,8 +12,13 @@ class CreatePagesTable extends Migration
*/
public
function
up
()
{
Schema
::
create
(
'pages'
,
function
(
Blueprint
$table
)
{
$table
->
engine
=
'MyISAM'
;
$pdo
=
\DB
::
connection
()
->
getPdo
();
$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
->
integer
(
'book_id'
);
$table
->
integer
(
'chapter_id'
);
...
...
database/migrations/2015_07_27_172342_create_chapters_table.php
View file @
1bec3ea
...
...
@@ -12,8 +12,12 @@ class CreateChaptersTable extends Migration
*/
public
function
up
()
{
Schema
::
create
(
'chapters'
,
function
(
Blueprint
$table
)
{
$table
->
engine
=
'MyISAM'
;
$pdo
=
\DB
::
connection
()
->
getPdo
();
$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
->
integer
(
'book_id'
);
$table
->
string
(
'slug'
)
->
indexed
();
...
...
Please
register
or
sign in
to post a comment