Commit Graph

11 Commits

Author SHA1 Message Date
Anthony Bocci
35dcc8c928 Use the table prefix on metric_points
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/#2955
2018-03-23 20:56:41 +01:00
James Brooks
1fdda03199 Metric repository now knows prefixes. Fixes #1938 2016-07-06 18:42:31 +01:00
James Brooks
712b1078f2 Fixes metrics repository in PGSQL. Closes #1741 2016-05-05 17:59:30 +01:00
James Brooks
f9bc46b460 Refactored the way we store metrics 2016-04-25 20:42:00 +01:00
James Brooks
58f755d136 Fix Last hour metric points. Closes #1482 2016-02-20 19:39:07 +00:00
Joseph Cohen
47bba0b927 Remove converting timezone for fetching 2016-02-02 11:15:47 -06:00
Graham Campbell
1b24cdb1c5 Improved the config system 2016-01-29 23:05:31 +00:00
James Brooks
6d97c2e3ee Fixes #1354 Postgres Last Hour Metrics 2016-01-20 09:26:02 +00:00
James Brooks
3a0c052f8b Last hour of metric points 2015-12-24 11:27:22 +00:00
James Brooks
02d59e3424 Finish the PgSqlRepository for metrics. Closes #1035 2015-10-14 20:59:11 +01:00
James Brooks
7136457b49 Improved metric repository for per-db methods. Closes #921 2015-08-30 22:36:19 +01:00