forked from DebaucheryLibrarian/traxxx
Storing actor socials, improved Hush profile scraper.
This commit is contained in:
@@ -17,7 +17,7 @@ exports.up = async (knex) => {
|
||||
AS showcased,
|
||||
releases.effective_date,
|
||||
releases.created_at,
|
||||
array_agg(tags.slug) FILTER (WHERE tags.slug IS NOT NULL) AS tags
|
||||
array_agg(tags.slug ORDER BY tags.priority DESC) FILTER (WHERE tags.slug IS NOT NULL) AS tags
|
||||
FROM releases
|
||||
LEFT JOIN releases_tags ON releases_tags.release_id = releases.id
|
||||
LEFT JOIN tags ON tags.id = releases_tags.tag_id
|
||||
|
||||
27
migrations/20230723001912_actors_social_entity.js
Normal file
27
migrations/20230723001912_actors_social_entity.js
Normal file
@@ -0,0 +1,27 @@
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('actors_social', (table) => {
|
||||
table.integer('profile_id')
|
||||
.references('id')
|
||||
.inTable('actors_profiles');
|
||||
|
||||
table.dropUnique(['url', 'actor_id']);
|
||||
table.unique(['url', 'actor_id', 'profile_id']);
|
||||
});
|
||||
|
||||
await knex.raw(`
|
||||
CREATE UNIQUE INDEX actors_social_url_actor_id_null_unique ON actors_social (url, actor_id) WHERE profile_id IS NULL;
|
||||
`);
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.raw(`
|
||||
DROP INDEX actors_social_url_actor_id_null_unique;
|
||||
`);
|
||||
|
||||
await knex.schema.alterTable('actors_social', (table) => {
|
||||
table.dropUnique(['url', 'actor_id', 'profile_id']);
|
||||
table.unique(['url', 'actor_id']);
|
||||
|
||||
table.dropColumn('profile_id');
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user