Describe the bug
php artisan migrate fails when migrating from V0.23
Steps To Reproduce
Steps to reproduce the behavior:
git pull origin release && composer install && php artisan migrateExpected behavior
Migrate to complete successfully.
Screenshots
Your Configuration (please complete the following information):
Additional context
I have had this happen on 2 different instances.
Same issue here, coming from 0.22.0.
On subsequent attempts:

And here's the copy-able text:
[2018-09-24 13:32:27] production.ERROR: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bookshelves' already exists (SQL: create table
bookshelves(idint unsigned not null auto_increment primary key,namevarchar(200) not null,slugvarchar(200) not null,descriptiontext not null,created_byint null,updated_byint null,restrictedtinyint(1) not null default '0',image_idint null,created_attimestamp null,updated_attimestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci) {"exception":"[object] (Illuminate\Database\QueryException(code: 42S01): SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bookshelves' already exists (SQL: create tablebookshelves(idint unsigned not null auto_increment primary key,namevarchar(200) not null,slugvarchar(200) not null,descriptiontext not null,created_byint null,updated_byint null,restrictedtinyint(1) not null default '0',image_idint null,created_attimestamp null,updated_attimestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci) at /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\DBAL\Driver\PDOException(code: 42S01): SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bookshelves' already exists at /var/www/bookstack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 42S01): SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bookshelves' already exists at /var/www/bookstack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"} []
[Illuminate\Database\QueryException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bookshelves' already exists (SQL: create tablebookshelves(idint unsigned not null auto_increment primary key,namevarchar(200) not null,slugvarchar(200) not null,descriptiontext not null,created_byint null,updated_byint null,restrictedtinyint(1) not null default '0',image_idint null,created_attimestamp null,updated_attimestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bookshelves' already exists
[PDOException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bookshelves' already exists
Thanks for reporting @NathanVaughn & @Jekotia.
Can either of you confirm MySQL versions?
And also, At any point, Have either of you been using MySQL 5.5 with BookStack?
Checking the engine used on the books table would be a big help, To see if it's InnoDB or MyISAM.
@ssddanbrown
$ mysql --version
mysql Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using EditLine wrapper
According to SHOW TABLE STATUS\G all tables are InnoDB except for the following, which are MyISAM:
@Jekotia Thanks for confirming, Just creating a patch now.
@ssddanbrown I manually applied the above commit and this is now the result when trying to migrate
[2018-09-24 15:10:37] production.ERROR: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'role_id' cannot be null (SQL: insert into
permission_role(permission_id,role_id) values (69, )) {"exception":"[object] (Illuminate\Database\QueryException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'role_id' cannot be null (SQL: insert intopermission_role(permission_id,role_id) values (69, )) at /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'role_id' cannot be null at /var/www/bookstack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'role_id' cannot be null at /var/www/bookstack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"} []
[Illuminate\Database\QueryException]
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'role_id' cannot be null (SQL: insert intopermission_role(permission_id,role_id) values (69, ))
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'role_id' cannot be null
[PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'role_id' cannot be null
@Jekotia Yeah, Came across that also, Just debugging it now.
@Jekotia @NathanVaughn Okay, Just pushed out a new release. Please try again. Hopefully should be covered now. Please confirm here how the upgrade want. Apologies for this issue.
The new release worked perfectly for me. Thanks so much @ssddanbrown.
Awesome, Hopefully that covers everything. Will close this then.
Fixed here as well. Thank you for the prompt resolution!