Storing actor socials, improved Hush profile scraper.
This commit is contained in:
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