-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ERROR: relation "metric_points" does not exist at character 90 #2955
Comments
👋 Hey, it's good to see you here! Thank you for opening your first issue. Cachet support is not available here, instead we have a Slack community that can you can join at https://cachethq-slack.herokuapp.com |
In the '.env' file, a 'DB_PREFIX' sets the prefix that should be used on every table name. When writing an SQL query the 'DB_PREFIX' value has to be prefixed to the table name. The repository PgSqlRepository, MySqlRepository and SqliteRepository, located in 'app/Repositories/Metric/' did not apply this prefix on the 'metric_points' table. The problem occured only when we set a 'DB_PREFIX' not null, the rest of the application worked correctly but the part about 'metric_points' couldn't work, saying the table was inexistant. A method was added in the repository AbstractMetricRepository to get the 'metric_points' table name with the prefix if there is one. This method is used in the three repositories to get the right table name. Note: This problem was present in 2.3, but was already fixed in 2.4 so there is no need to apply this commit on the 2.4 branch. See: CachetHQ/Cachet/cachethq#2955
In the repositories ( I've a branch where I've fixed this problem by adding a method, could you try if everything is good for you before I submit a pull request? |
Closed by #2960 |
Hi all,
Install of Cachet version 2.3.13 , running through docker-compose with Postgres.
On a pageload where a metric (2) is enabled the following Postgres error is logged:
In the cachet the following error is logged:
I have checked the tables that do exist in postgres:
A metric was created , and some data was populated into metric/2 .
Observing the query provided to postgres , mentions table metric_points instead of the chq_metric_points.
I have talked with @anthonybocci , which also evaluated this and is going to evaluate/implement the fix.
Thanks everyone,
The text was updated successfully, but these errors were encountered: