core
core copied to clipboard
Add support for MariaDB
Bug description
Just did a fresh install of the project, the whole installation process succeeded, migrations has run, db tables created, created a user also.
So I went to the project url and get 500 error. The logs say: Column not found: 1054 Unknown column 'posts.id' in 'where clause'
Steps to reproduce
Follow the steps as described here: https://waterhole.dev/docs/main/installation
Logs
[2023-11-10 20:20:11] local.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'posts.id' in 'where clause' (Connection: mysql, SQL: select `posts`.*, (select COUNT(*) from `comments` where `comments`.`post_id` = `posts`.`id` and `comments`.`created_at` > `last_read_at`) as `unread_comments_count`, (select JSON_OBJECTAGG(a.reaction_type_id, count) from (select reaction_type_id, count(*) as count from `reactions` where `content_type` = post and `content_id` = `posts`.`id` group by `reaction_type_id`) as `a`) as `reaction_counts` from `posts` left join `post_user` on `post_user`.`post_id` = `posts`.`id` and `post_user`.`user_id` is null where not exists (select * from `channels` where `posts`.`channel_id` = `channels`.`id` and (exists (select * from `channel_user` where `channels`.`id` = `channel_user`.`channel_id` and `notifications` = ignore and `channel_user`.`user_id` is null) or (`ignore` = 1 and not exists (select * from `channel_user` where `channels`.`id` = `channel_user`.`channel_id` and `notifications` is not null and `channel_user`.`user_id` is null))) and `id` in (1, 2, 3, 4)) and (`channel_id` in (1, 2, 3, 4) and `deleted_at` is null or 0 = 1) and `posts`.`deleted_at` is null and not (exists (select * from `post_user` where `posts`.`id` = `post_user`.`post_id` and `notifications` = ignore and `post_user`.`user_id` is null)) order by `last_activity_at` desc limit 16) {"view":{"view":"../mysite.com/vendor/waterhole/core/resources/views/components/post-feed.blade.php","data":[]},"exception":"[object] (Spatie\\LaravelIgnition\\Exceptions\\ViewException(code: 0): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'posts.id' in 'where clause' (Connection: mysql, SQL: select `posts`.*, (select COUNT(*) from `comments` where `comments`.`post_id` = `posts`.`id` and `comments`.`created_at` > `last_read_at`) as `unread_comments_count`, (select JSON_OBJECTAGG(a.reaction_type_id, count) from (select reaction_type_id, count(*) as count from `reactions` where `content_type` = post and `content_id` = `posts`.`id` group by `reaction_type_id`) as `a`) as `reaction_counts` from `posts` left join `post_user` on `post_user`.`post_id` = `posts`.`id` and `post_user`.`user_id` is null where not exists (select * from `channels` where `posts`.`channel_id` = `channels`.`id` and (exists (select * from `channel_user` where `channels`.`id` = `channel_user`.`channel_id` and `notifications` = ignore and `channel_user`.`user_id` is null) or (`ignore` = 1 and not exists (select * from `channel_user` where `channels`.`id` = `channel_user`.`channel_id` and `notifications` is not null and `channel_user`.`user_id` is null))) and `id` in (1, 2, 3, 4)) and (`channel_id` in (1, 2, 3, 4) and `deleted_at` is null or 0 = 1) and `posts`.`deleted_at` is null and not (exists (select * from `post_user` where `posts`.`id` = `post_user`.`post_id` and `notifications` = ignore and `post_user`.`user_id` is null)) order by `last_activity_at` desc limit 16) at ../mysite.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:822)
[stacktrace]
Environment
Environment
...............................
Application Name: MyProject
Laravel Version: 10.31.0
PHP Version: 8.2.12
Composer Version: 2.6.5
Environment: local
Debug Mode: ENABLED
URL: myproject.com
Maintenance Mode: OFF
Waterhole Version: 0.3.0