Added rename to tag seed.
This commit is contained in:
@@ -114,6 +114,7 @@ const tags = [
|
||||
{
|
||||
name: 'anal',
|
||||
slug: 'anal',
|
||||
rename: 'ass-fucking',
|
||||
description: 'Getting your asshole fucked. Generally considered naughtier, you may or may not find it a pleasurable alternative to vaginal sex.',
|
||||
group: 'penetration',
|
||||
},
|
||||
@@ -554,8 +555,9 @@ const tags = [
|
||||
slug: 'electric-shock',
|
||||
},
|
||||
{
|
||||
name: 'enhanced boobs',
|
||||
slug: 'enhanced-boobs',
|
||||
name: 'fake tits',
|
||||
slug: 'fake-tits',
|
||||
rename: 'enhanced-boobs',
|
||||
},
|
||||
{
|
||||
name: 'enhanced butt',
|
||||
@@ -868,8 +870,9 @@ const tags = [
|
||||
group: 'position',
|
||||
},
|
||||
{
|
||||
name: 'natural boobs',
|
||||
slug: 'natural-boobs',
|
||||
name: 'natural tits',
|
||||
slug: 'natural-tits',
|
||||
rename: 'natural-boobs',
|
||||
group: 'body',
|
||||
},
|
||||
{
|
||||
@@ -1651,15 +1654,17 @@ const aliases = [
|
||||
name: 'big butts',
|
||||
for: 'big-butt',
|
||||
},
|
||||
{
|
||||
name: 'natural boobs',
|
||||
for: 'natural-tits',
|
||||
},
|
||||
{
|
||||
name: 'big natural tits',
|
||||
for: 'big-boobs',
|
||||
implies: ['natural-boobs'],
|
||||
},
|
||||
{
|
||||
name: 'big natural boobs',
|
||||
for: 'big-boobs',
|
||||
implies: ['natural-boobs'],
|
||||
},
|
||||
{
|
||||
name: 'big tits',
|
||||
@@ -1739,12 +1744,17 @@ const aliases = [
|
||||
},
|
||||
{
|
||||
name: 'fake boobs',
|
||||
for: 'enhanced-boobs',
|
||||
for: 'fake-tits',
|
||||
secondary: true,
|
||||
},
|
||||
{
|
||||
name: 'enhanced boobs',
|
||||
for: 'fake-tits',
|
||||
secondary: true,
|
||||
},
|
||||
{
|
||||
name: 'implants',
|
||||
for: 'enhanced-boobs',
|
||||
for: 'fake-tits',
|
||||
},
|
||||
{
|
||||
name: 'boob job',
|
||||
@@ -1752,7 +1762,7 @@ const aliases = [
|
||||
},
|
||||
{
|
||||
name: 'boobjob',
|
||||
for: 'enhanced-boobs',
|
||||
for: 'fake-tits',
|
||||
},
|
||||
{
|
||||
name: 'brown hair',
|
||||
@@ -2017,11 +2027,11 @@ const aliases = [
|
||||
},
|
||||
{
|
||||
name: 'enhanced',
|
||||
for: 'enhanced-boobs',
|
||||
for: 'fake-tits',
|
||||
},
|
||||
{
|
||||
name: 'enhanced tits',
|
||||
for: 'enhanced-boobs',
|
||||
for: 'fake-tits',
|
||||
},
|
||||
{
|
||||
name: 'fake butt',
|
||||
@@ -2064,11 +2074,6 @@ const aliases = [
|
||||
name: 'facial - multiple',
|
||||
for: 'facial',
|
||||
},
|
||||
{
|
||||
name: 'fake tits',
|
||||
for: 'enhanced-boobs',
|
||||
secondary: true,
|
||||
},
|
||||
{
|
||||
name: 'feet sex',
|
||||
for: 'foot-sex',
|
||||
@@ -2218,11 +2223,7 @@ const aliases = [
|
||||
},
|
||||
{
|
||||
name: 'natural',
|
||||
for: 'natural-boobs',
|
||||
},
|
||||
{
|
||||
name: 'natural tits',
|
||||
for: 'natural-boobs',
|
||||
for: 'natural-tits',
|
||||
},
|
||||
{
|
||||
name: 'natural butt',
|
||||
@@ -3109,7 +3110,7 @@ const aliases = [
|
||||
const priorities = [ // higher index is higher priority
|
||||
['blonde', 'brunette', 'black-hair', 'redhead'],
|
||||
['asian', 'black', 'latina', 'white', 'interracial'],
|
||||
['enhanced-boobs', 'natural-boobs'],
|
||||
['fake-tits', 'natural-tits'],
|
||||
['bts'],
|
||||
['blowjob', 'deepthroat', 'oil'],
|
||||
['toys', 'toy-anal', 'toy-dp', 'piss-drinking'],
|
||||
@@ -3135,6 +3136,28 @@ const priorities = [ // higher index is higher priority
|
||||
exports.seed = (knex) => Promise.resolve()
|
||||
.then(async () => upsert('tags_groups', groups, 'slug', knex))
|
||||
.then(async () => {
|
||||
await Promise.all(tags.map((async (tag) => {
|
||||
if (tag.rename) {
|
||||
await knex('tags')
|
||||
.where('name', tag.name)
|
||||
.whereNotNull('alias_for')
|
||||
.delete();
|
||||
|
||||
await knex('tags')
|
||||
.where('slug', tag.rename)
|
||||
.update({
|
||||
name: tag.name,
|
||||
slug: tag.slug,
|
||||
});
|
||||
}
|
||||
|
||||
if (tag.delete) {
|
||||
await knex('tags')
|
||||
.where('slug', tag.rename)
|
||||
.delete();
|
||||
}
|
||||
})));
|
||||
|
||||
const groupEntries = await knex('tags_groups').select('*');
|
||||
const groupsMap = groupEntries.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user