Documentation "error": UTF8mb4/emoji support #504

Closed
opened 2026-02-04 20:37:17 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Blizzke on GitHub (Nov 16, 2017).

On this page the procedure to recreate the database is described in case you get the "key to long"-error.

As it is described there it will not work, given that you are also making a backup of the migrations table which will be filled again when you run artisan migrate and then the restore will fail.

I think it might be easier to just add a drop the migration-table to the beginning of the document (before creating the dump), that should solve everything.

Originally created by @Blizzke on GitHub (Nov 16, 2017). On [this page](https://www.bookstackapp.com/docs/admin/ut8mb4-support/) the procedure to recreate the database is described in case you get the "key to long"-error. As it is described there it will not work, given that you are also making a backup of the `migrations` table which will be filled again when you run `artisan migrate` and then the restore will fail. I think it might be easier to just add a _drop the `migration`-table_ to the beginning of the document (before creating the dump), that should solve everything.
Author
Owner

@Blizzke commented on GitHub (Nov 16, 2017):

Okay: it's actually much worse: The problem also occurs for permissions_role, role_permissions, role_user, roles and users table. Basically as is, that guide is unusable without emptying up all those tables first after you ran the migrate command.

So if you have an instance that is in use, you should run this after you ran artisan migrate:

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE migrations;
TRUNCATE role_permissions;
TRUNCATE permission_role;
TRUNCATE role_user;
TRUNCATE roles;
TRUNCATE users;
SET FOREIGN_KEY_CHECKS = 1;

Normally your backup contains data to refill those tables

@Blizzke commented on GitHub (Nov 16, 2017): Okay: it's actually much worse: The problem also occurs for `permissions_role`, `role_permissions`, `role_user`, `roles` and `users` table. Basically as is, that guide is unusable without emptying up all those tables first after you ran the `migrate` command. So if you have an instance that is in use, you should run this after you ran `artisan migrate`: ``` SET FOREIGN_KEY_CHECKS = 0; TRUNCATE migrations; TRUNCATE role_permissions; TRUNCATE permission_role; TRUNCATE role_user; TRUNCATE roles; TRUNCATE users; SET FOREIGN_KEY_CHECKS = 1; ``` Normally your backup contains data to refill those tables
Author
Owner

@ssddanbrown commented on GitHub (May 11, 2022):

Since this is an old issue I'll close this off.

@ssddanbrown commented on GitHub (May 11, 2022): Since this is an old issue I'll close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#504