Template field ist not exist in DB #1417

Closed
opened 2026-02-05 00:50:38 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @vfriesen on GitHub (Oct 23, 2019).

Hallo,

Steps To Reproduce
on create a new Page for a one book, i get the unknown error.
The issue seems to be a missing field in the db table 'pages' => templates
after i add it manuell, it works.
I think you have forgot to write a migration for.

Screenshots
pages | CREATE TABLE pages (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
book_id int(11) NOT NULL,
chapter_id int(11) NOT NULL,
name varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
slug varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
html longtext COLLATE utf8mb4_unicode_ci NOT NULL,
text longtext COLLATE utf8mb4_unicode_ci NOT NULL,
priority int(11) NOT NULL,
created_at timestamp NULL DEFAULT NULL,
updated_at timestamp NULL DEFAULT NULL,
created_by int(11) NOT NULL,
updated_by int(11) NOT NULL,
restricted tinyint(1) NOT NULL DEFAULT '0',
draft tinyint(1) NOT NULL DEFAULT '0',
markdown longtext COLLATE utf8mb4_unicode_ci NOT NULL,
revision_count int(11) NOT NULL,
PRIMARY KEY (id),
KEY pages_slug_index (slug),
KEY pages_book_id_index (book_id),
KEY pages_chapter_id_index (chapter_id),
KEY pages_priority_index (priority),
KEY pages_created_by_index (created_by),
KEY pages_updated_by_index (updated_by),
KEY pages_restricted_index (restricted),
KEY pages_draft_index (draft)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings):BookStack v0.27.5
  • PHP Version:7.3
  • Hosting Method (Nginx/Apache/Docker): Apache
Originally created by @vfriesen on GitHub (Oct 23, 2019). Hallo, **Steps To Reproduce** on create a new Page for a one book, i get the unknown error. The issue seems to be a missing field in the db table 'pages' => templates after i add it manuell, it works. I think you have forgot to write a migration for. **Screenshots** pages | CREATE TABLE `pages` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `book_id` int(11) NOT NULL, `chapter_id` int(11) NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `html` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `text` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `priority` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `created_by` int(11) NOT NULL, `updated_by` int(11) NOT NULL, `restricted` tinyint(1) NOT NULL DEFAULT '0', `draft` tinyint(1) NOT NULL DEFAULT '0', `markdown` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `revision_count` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `pages_slug_index` (`slug`), KEY `pages_book_id_index` (`book_id`), KEY `pages_chapter_id_index` (`chapter_id`), KEY `pages_priority_index` (`priority`), KEY `pages_created_by_index` (`created_by`), KEY `pages_updated_by_index` (`updated_by`), KEY `pages_restricted_index` (`restricted`), KEY `pages_draft_index` (`draft`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci | **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings):BookStack v0.27.5 - PHP Version:7.3 - Hosting Method (Nginx/Apache/Docker): Apache
Author
Owner

@ssddanbrown commented on GitHub (Oct 23, 2019):

Hi @vfriesen,
The migration exists here: https://github.com/BookStackApp/BookStack/blob/v0.27.5/database/migrations/2019_07_07_112515_add_template_support.php

The odd thing is that some other users have experienced the same issue but I can't nail it down. Could you confirm your version of MySQL?
I'd also be interested in seeing the output of running php artisan migrate:status.

Ideally you'd still run the migration to create this field instead of doing it manually otherwise you could have issues on future updates.

@ssddanbrown commented on GitHub (Oct 23, 2019): Hi @vfriesen, The migration exists here: https://github.com/BookStackApp/BookStack/blob/v0.27.5/database/migrations/2019_07_07_112515_add_template_support.php The odd thing is that some other users have experienced the same issue but I can't nail it down. Could you confirm your version of MySQL? I'd also be interested in seeing the output of running `php artisan migrate:status`. Ideally you'd still run the migration to create this field instead of doing it manually otherwise you could have issues on future updates.
Author
Owner

@ssddanbrown commented on GitHub (Sep 29, 2020):

Since there has been no further development here I'll close this off.

@ssddanbrown commented on GitHub (Sep 29, 2020): Since there has been no further development here 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#1417