Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MariaDB #39

Open
frankeymen opened this issue Nov 10, 2023 · 2 comments
Open

Add support for MariaDB #39

frankeymen opened this issue Nov 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@frankeymen
Copy link

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
@tobyzerner
Copy link
Member

I can't reproduce this, but it seems like the same error as another user who was using MariaDB. What database are you using?

@frankeymen
Copy link
Author

frankeymen commented Nov 11, 2023

Hi @tobyzerner, you are right about using MariaDB 10.3, any chance Waterhole will support both databases on the future? Laravel Eloquent is solving these differences by default right? It might give the Waterhole project more traction when multiple database types are supported.

@tobyzerner tobyzerner changed the title Column not found: 1054 Unknown column 'posts.id' in 'where clause' Add support for MariaDB Nov 17, 2023
@tobyzerner tobyzerner added the enhancement New feature or request label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants