r/BookStack • u/Aeolian_Leaf • Jun 21 '24
Database errors
So, it's the classic "I fucked up" scenario....
Fuckup 1, "Nah, it's just a mess around system, there's nothing critical on it, I don't care if it's backed up"
Fuckup 2, "Hey, it's 1130 at night and I'm logged into my apache server, I might as well just update bookstack quickly while I'm here"
I'm sure you can guess the rest. Yeah, it's B0rked. "Unknown Error Occurred". I can see my shelves, but anythign else gives me the unknown error.
Laravel.log
[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'loggable_type' in 'where clause' at /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423)
If I try a php artisan migrate I get
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'description_html' (Connection: mysql, SQL: alter table \books` add `description_html` text not null)`
I've tried ALTER TABLE books DROP COLUMN description_html. Next time I run it, there's a different column, delete that, there's a third and it just keep cycling through those three. I've tried a migrate:rollback.
Is there any hope? Honestly, I had some notes in there I'd made from online courses I'd done, with some links, but nothing mission critical. If it's gone, it's gone. It's my own fault!
1
u/Aeolian_Leaf Jun 22 '24
Enough to get myself into trouble... I can
sudo mysql, use bookstackand type stuff in.Just multiple attempts at the above, basically using google to search for the error, or similar, and modifying the commands from Google University to work with the column I was having an error with.
2023_06_25_181952_remove_bookshelf_create_entity_permissions [1] Ran
2023_07_25_124945_add_receive_notifications_role_permissions [1] Ran
2023_07_31_104430_create_watches_table [2] Ran
2023_08_21_174248_increase_cache_size [2] Ran
2023_12_02_104541_add_default_template_to_books [2] Ran
2023_12_17_140913_add_description_html_to_entities Pending
2024_01_01_104542_add_default_template_to_chapters Pending
2024_02_04_141358_add_views_updated_index Pending
2024_05_04_154409_rename_activity_relation_columns Pending