Storing scene qualities. Updated Perv City scraper.
This commit is contained in:
7
migrations/20220331135618_qualities.js
Normal file
7
migrations/20220331135618_qualities.js
Normal file
@@ -0,0 +1,7 @@
|
||||
exports.up = async (knex) => knex.schema.alterTable('releases', (table) => {
|
||||
table.specificType('qualities', 'text[]');
|
||||
});
|
||||
|
||||
exports.down = async (knex) => knex.schema.alterTable('releases', (table) => {
|
||||
table.dropColumn('qualities');
|
||||
});
|
||||
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