Storing scene qualities. Updated Perv City scraper.
This commit is contained in:
12
migrations/_20220330230122_stats.js
Normal file
12
migrations/_20220330230122_stats.js
Normal file
@@ -0,0 +1,12 @@
|
||||
exports.up = async (knex) => knex.raw(`
|
||||
CREATE MATERIALIZED VIEW entities_stats
|
||||
AS
|
||||
SELECT entities.id AS entity_id, count(releases.id) AS releases_count
|
||||
FROM entities
|
||||
LEFT JOIN releases ON releases.entity_id = entities.id
|
||||
GROUP BY entities.id;
|
||||
`);
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP MATERIALIZED VIEW entities_stats;
|
||||
`);
|
||||
Reference in New Issue
Block a user