const upsert = require('../src/utils/upsert');

const groups = [
    {
        slug: 'age',
        name: 'Age',
    },
    {
        slug: 'body',
        name: 'Body',
    },
    {
        slug: 'clothing',
        name: 'Clothing',
    },
    {
        slug: 'ethnicity',
        name: 'Ethnicity',
    },
    {
        slug: 'finish',
        name: 'Finish',
    },
    {
        slug: 'group',
        name: 'Group sex',
    },
    {
        slug: 'hair',
        name: 'Hair',
    },
    {
        slug: 'location',
        name: 'Location',
    },
    {
        slug: 'oral',
        name: 'Oral',
    },
    {
        slug: 'orientation',
        name: 'Orientation',
    },
    {
        slug: 'penetration',
        name: 'Penetration',
    },
    {
        slug: 'position',
        name: 'Position',
    },
    {
        slug: 'roleplay',
        name: 'Roleplay',
    },
];

function getTags(groupsMap) {
    return [
        {
            name: '4K',
            slug: '4k',
            description: 'Available in high quality 4K resolution.',
            alias_for: null,
        },
        {
            name: '69',
            slug: '69',
            alias_for: null,
            group_id: groupsMap.position,
        },
        {
            name: 'airtight',
            slug: 'airtight',
            alias_for: null,
            description: 'Stuffing one cock in her ass, one in her pussy, and one in her mouth, filling all of her penetrable holes and sealing her airtight like a figurative balloon. In other words, simultaneously getting [double penetrated](/tag/double-penetration), and giving a [blowjob](/tag/blowjob) or getting [facefucked](/tag/facefuck). Being airtight implies being [gangbanged](/tag/gangbang).', /* eslint-disable-line max-len */
            priority: 9,
            group_id: groupsMap.penetration,
        },
        {
            name: 'amateur',
            slug: 'amateur',
            alias_for: null,
        },
        {
            name: 'anal creampie',
            slug: 'anal-creampie',
            priority: 7,
            alias_for: null,
            description: 'Ejaculating into the asshole.',
            group_id: groupsMap.finish,
        },
        {
            name: 'anal',
            slug: 'anal',
            description: 'Taking a cock in the asshole.',
            priority: 9,
            alias_for: null,
            group_id: groupsMap.penetration,
        },
        {
            name: 'ass fingering',
            slug: 'ass-fingering',
            description: 'Inserting one or multiple fingers into the asshole.',
            alias_for: null,
        },
        {
            name: 'anal fisting',
            slug: 'anal-fisting',
            description: 'Shoving an entire hand into the asshole.',
            alias_for: null,
        },
        {
            name: 'anal prolapse',
            slug: 'anal-prolapse',
            alias_for: null,
        },
        {
            name: 'anal toys',
            slug: 'anal-toys',
            description: 'Stuffing a toy, such as a dildo or buttplug, into the ass',
            alias_for: null,
        },
        {
            name: 'animated',
            slug: 'animated',
            alias_for: null,
        },
        {
            name: 'asian',
            slug: 'asian',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.ethnicity,
        },
        {
            name: 'athletic',
            slug: 'athletic',
            alias_for: null,
            group_id: groupsMap.body,
        },
        {
            name: 'ass to mouth',
            slug: 'ass-to-mouth',
            priority: 6,
            description: 'Sucking off a cock right after anal, giving your own or someone else\'s asshole a second hand taste.',
            alias_for: null,
            group_id: groupsMap.oral,
        },
        {
            name: 'ass eating',
            slug: 'ass-eating',
            alias_for: null,
            group_id: groupsMap.oral,
        },
        {
            name: 'ball licking',
            slug: 'ball-licking',
            alias_for: null,
            group_id: groupsMap.oral,
        },
        {
            name: 'ballerina',
            slug: 'ballerina',
            alias_for: null,
            group_id: groupsMap.roleplay,
        },
        {
            name: 'bathroom',
            slug: 'bathroom',
            alias_for: null,
            group_id: groupsMap.location,
        },
        {
            name: 'BDSM',
            slug: 'bdsm',
            priority: 8,
            alias_for: null,
        },
        {
            name: 'BBC',
            slug: 'bbc',
            alias_for: null,
            group_id: groupsMap.body,
        },
        {
            name: 'big dick',
            slug: 'big-dick',
            alias_for: null,
            group_id: groupsMap.body,
        },
        {
            name: 'big butt',
            slug: 'big-butt',
            alias_for: null,
            group_id: groupsMap.body,
        },
        {
            name: 'big boobs',
            slug: 'big-boobs',
            alias_for: null,
            group_id: groupsMap.body,
        },
        {
            name: 'bisexual',
            slug: 'bisexual',
            alias_for: null,
        },
        {
            name: 'black hair',
            slug: 'black-hair',
            alias_for: null,
            group_id: groupsMap.hair,
        },
        {
            name: 'blonde',
            slug: 'blonde',
            alias_for: null,
            group_id: groupsMap.hair,
        },
        {
            name: 'blowjob',
            slug: 'blowjob',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.oral,
        },
        {
            name: 'blowbang',
            slug: 'blowbang',
            priority: 9,
            description: 'Pleasuring a gang of three or more cocks by sucking and jerking off as many cocks as they can, often getting [facefucked](/tag/facefuck), groped and rubbed out, and followed by a [bukkake](/tag/bukkake). If they are getting fucked, it is a [gangbang](/tag/gangbang).',
            alias_for: null,
            group_id: groupsMap.group,
        },
        {
            name: 'bondage',
            slug: 'bondage',
            alias_for: null,
        },
        {
            name: 'brunette',
            slug: 'brunette',
            alias_for: null,
            group_id: groupsMap.hair,
        },
        {
            name: 'bukkake',
            slug: 'bukkake',
            priority: 8,
            description: 'Getting ejaculated on the face by a group of three or more men, often following a [blowbang](/tag/blowbang) or [gangbang](/tag/gangbang).',
            alias_for: null,
            group_id: groupsMap.finish,
        },
        {
            name: 'cheerleader',
            slug: 'cheerleader',
            alias_for: null,
            group_id: groupsMap.roleplay,
        },
        {
            name: 'choking',
            slug: 'choking',
            alias_for: null,
        },
        {
            name: 'corporal punishment',
            slug: 'corporal-punishment',
            alias_for: null,
        },
        {
            name: 'couples',
            slug: 'couples',
            alias_for: null,
        },
        {
            name: 'cowgirl',
            slug: 'cowgirl',
            alias_for: null,
        },
        {
            name: 'creampie',
            slug: 'creampie',
            priority: 8,
            description: 'Ejaculalating into her pussy, often shown visibly dripping out afterwards.',
            alias_for: null,
            group_id: groupsMap.finish,
        },
        {
            name: 'cum licking',
            slug: 'cum-licking',
            alias_for: null,
        },
        {
            name: 'cum on butt',
            slug: 'cum-on-butt',
            alias_for: null,
        },
        {
            name: 'cum on boobs',
            slug: 'cum-on-boobs',
            alias_for: null,
        },
        {
            name: 'cum swapping',
            slug: 'cum-swapping',
            alias_for: null,
        },
        {
            name: 'cumshot',
            slug: 'cumshot',
            alias_for: null,
        },
        {
            name: 'curvy',
            slug: 'curvy',
            alias_for: null,
        },
        {
            name: 'double anal',
            slug: 'double-anal',
            description: 'Two cocks in the ass at the same time. If there\'s a third cock in her pussy, it is [double anal TP](/tag/da-tp).',
            priority: 8,
            alias_for: null,
            group_id: groupsMap.penetration,
        },
        {
            name: 'triple anal',
            slug: 'triple-anal',
            description: 'Getting fucked in the ass by not one, two, but *three* cocks at the same time.',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.penetration,
        },
        {
            name: 'deepthroat',
            slug: 'deepthroat',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.oral,
        },
        {
            name: 'double penetration',
            slug: 'double-penetration',
            priority: 9,
            alias_for: null,
            description: 'Fucking two cocks at once, with one in her ass, and one in her pussy. If she has another cock in her mouth, she is [airtight](/tag/airtight).',
            group_id: groupsMap.penetration,
        },
        {
            name: 'dungeon',
            slug: 'dungeon',
            alias_for: null,
        },
        {
            name: 'double vaginal',
            slug: 'double-vaginal',
            description: 'Fucking her pussy with two cocks at the same time. If there\'s a third cock in her asshole, it is [double vaginal TP](/tag/dv-tp).',
            priority: 8,
            alias_for: null,
            group_id: groupsMap.penetration,
        },
        {
            name: 'double blowjob',
            slug: 'double-blowjob',
            alias_for: null,
            group_id: groupsMap.oral,
        },
        {
            name: 'doggy style',
            slug: 'doggy-style',
            alias_for: null,
            group_id: groupsMap.position,
        },
        {
            name: 'dress',
            slug: 'dress',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'ebony',
            slug: 'ebony',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.ethnicity,
        },
        {
            name: 'electric shock',
            slug: 'electric-shock',
            alias_for: null,
        },
        {
            name: 'enhanced boobs',
            slug: 'enhanced-boobs',
            alias_for: null,
        },
        {
            name: 'facefucking',
            slug: 'facefucking',
            priority: 9,
            alias_for: null,
            group_id: groupsMap.oral,
        },
        {
            name: 'facesitting',
            slug: 'facesitting',
            alias_for: null,
            group_id: groupsMap.position,
        },
        {
            name: 'facial',
            slug: 'facial',
            alias_for: null,
            group_id: groupsMap.finish,
        },
        {
            name: 'family taboo',
            slug: 'family',
            alias_for: null,
        },
        {
            name: 'feet',
            slug: 'feet',
            alias_for: null,
        },
        {
            name: 'femdom',
            slug: 'femdom',
            alias_for: null,
        },
        {
            name: 'fingering',
            slug: 'fingering',
            alias_for: null,
        },
        {
            name: 'fisting',
            slug: 'fisting',
            alias_for: null,
        },
        {
            name: 'MFF threesome',
            slug: 'mff',
            priority: 9,
            description: 'A threesome with two women and one guy, in which the women have sex with eachother.',
            alias_for: null,
            group_id: groupsMap.group,
        },
        {
            name: 'gag',
            slug: 'gag',
            alias_for: null,
        },
        {
            name: 'gangbang',
            slug: 'gangbang',
            description: 'A group of three or more guys fucking a woman, at least two at the same time, often but not necessarily involving a [blowbang](/tag/blowbang), [double penetration](/tag/airtight) and [airtight](/tag/airtight). If she only gets fucked by one guy at a time, it might be considered a [trainbang](/tag/trainbang) instead. In a reverse gangbang, multiple women fuck one man.', /* eslint-disable-line max-len */
            alias_for: null,
            priority: 9,
            group_id: groupsMap.group,
        },
        {
            name: 'glasses',
            slug: 'glasses',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'fake cum',
            slug: 'fake-cum',
            alias_for: null,
            group_id: groupsMap.finish,
        },
        {
            name: 'trainbang',
            slug: 'trainbang',
            description: 'A group of three or more guys fucking a woman as in a [gangbang](/tag/gangbang), but one after the other, and never at the same time.',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.group,
        },
        {
            name: 'gaping',
            slug: 'gaping',
            alias_for: null,
        },
        {
            name: 'gay',
            slug: 'gay',
            priority: 10,
            alias_for: null,
        },
        {
            name: 'gonzo',
            slug: 'gonzo',
            alias_for: null,
        },
        {
            name: 'hairy',
            slug: 'hairy',
            alias_for: null,
            group_id: groupsMap.body,
        },
        {
            name: 'handjob',
            slug: 'handjob',
            alias_for: null,
        },
        {
            name: 'hardcore',
            slug: 'hardcore',
            alias_for: null,
        },
        {
            name: 'high heels',
            slug: 'high-heels',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'humiliation',
            slug: 'humiliation',
            alias_for: null,
        },
        {
            name: 'innie pussy',
            slug: 'innie-pussy',
            alias_for: null,
        },
        {
            name: 'interracial',
            slug: 'interracial',
            priority: 9,
            alias_for: null,
            group_id: groupsMap.ethnicity,
        },
        {
            name: 'kissing',
            slug: 'kissing',
            alias_for: null,
        },
        {
            name: 'latex',
            slug: 'latex',
            alias_for: null,
        },
        {
            name: 'Latina',
            slug: 'latina',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.ethnicity,
        },
        {
            name: 'leather',
            slug: 'leather',
            alias_for: null,
        },
        {
            name: 'lesbian',
            slug: 'lesbian',
            priority: 9,
            alias_for: null,
        },
        {
            name: 'machine dildo',
            slug: 'machine-dildo',
            alias_for: null,
        },
        {
            name: 'lingerie',
            slug: 'lingerie',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'maid',
            slug: 'maid',
            alias_for: null,
            group_id: groupsMap.roleplay,
        },
        {
            name: 'massage',
            slug: 'massage',
            alias_for: null,
        },
        {
            name: 'masturbation',
            slug: 'masturbation',
            alias_for: null,
        },
        {
            name: 'MILF',
            slug: 'milf',
            alias_for: null,
            priority: 7,
            group_id: groupsMap.age,
        },
        {
            name: 'MFM threesome',
            slug: 'mfm',
            priority: 9,
            description: 'Two men fucking one woman, but not eachother. Typically involves a \'spitroast\', where one guy gets a blowjob and the other fucks her pussy.',
            alias_for: null,
            group_id: groupsMap.group,
        },
        {
            name: 'miniskirt',
            slug: 'miniskirt',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'missionary',
            slug: 'missionary',
            alias_for: null,
            group_id: groupsMap.position,
        },
        {
            name: 'natural boobs',
            slug: 'natural-boobs',
            alias_for: null,
            group_id: groupsMap.body,
        },
        {
            name: 'nipple clamps',
            slug: 'nipple-clamps',
            alias_for: null,
        },
        {
            name: 'oil',
            slug: 'oil',
            alias_for: null,
        },
        {
            name: 'oral creampie',
            slug: 'oral-creampie',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.finish,
        },
        {
            name: 'orgy',
            slug: 'orgy',
            priority: 9,
            description: 'A group of (at least four) people having sex with eachother. If only one person is getting fucked, it is probably a [gangbang](/tag/gangbang).',
            alias_for: null,
            group_id: groupsMap.group,
        },
        {
            name: 'outdoors',
            slug: 'outdoors',
            alias_for: null,
            group_id: groupsMap.location,
        },
        {
            name: 'outie pussy',
            slug: 'outie-pussy',
            alias_for: null,
        },
        {
            name: 'pain',
            slug: 'pain',
            alias_for: null,
        },
        {
            name: 'parody',
            slug: 'parody',
            alias_for: null,
        },
        {
            name: 'pegging',
            slug: 'pegging',
            alias_for: null,
        },
        {
            name: 'petite',
            slug: 'petite',
            alias_for: null,
        },
        {
            name: 'piercings',
            slug: 'piercings',
            alias_for: null,
        },
        {
            name: 'POV',
            slug: 'pov',
            alias_for: null,
        },
        {
            name: 'pussy eating',
            slug: 'pussy-eating',
            alias_for: null,
            group_id: groupsMap.oral,
        },
        {
            name: 'redhead',
            slug: 'redhead',
            alias_for: null,
            group_id: groupsMap.hair,
        },
        {
            name: 'reverse cowgirl',
            slug: 'reverse-cowgirl',
            alias_for: null,
        },
        {
            name: 'roleplay',
            slug: 'roleplay',
            alias_for: null,
        },
        {
            name: 'rough',
            slug: 'rough',
            priority: 7,
            alias_for: null,
        },
        {
            name: 'saliva',
            slug: 'saliva',
            alias_for: null,
        },
        {
            name: 'schoolgirl',
            slug: 'schoolgirl',
            alias_for: null,
            group_id: groupsMap.roleplay,
        },
        {
            name: 'shaved',
            slug: 'shaved',
            alias_for: null,
        },
        {
            name: 'shoes on',
            slug: 'shoes-on',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'short hair',
            slug: 'short-hair',
            alias_for: null,
            group_id: groupsMap.hair,
        },
        {
            name: 'skirt',
            slug: 'skirt',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'slapping',
            slug: 'slapping',
            alias_for: null,
        },
        {
            name: 'sloppy blowjob',
            slug: 'sloppy-blowjob',
            alias_for: null,
        },
        {
            name: 'socks',
            slug: 'socks',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'solo',
            slug: 'solo',
            alias_for: null,
        },
        {
            name: 'spanking',
            slug: 'spanking',
            alias_for: null,
        },
        {
            name: 'spooning',
            slug: 'spooning',
            alias_for: null,
            group_id: groupsMap.position,
        },
        {
            name: 'strapon',
            slug: 'strapon',
            group_id: groupsMap['strap-on-dildo'],
        },
        {
            name: 'small boobs',
            slug: 'small-boobs',
            alias_for: null,
        },
        {
            name: 'small butt',
            slug: 'small-butt',
            alias_for: null,
        },
        {
            name: 'speculum',
            slug: 'speculum',
            alias_for: null,
        },
        {
            name: 'squirting',
            slug: 'squirting',
            alias_for: null,
        },
        {
            name: 'standing doggy style',
            slug: 'standing-doggy-style',
            alias_for: null,
        },
        {
            name: 'stockings',
            slug: 'stockings',
            alias_for: null,
            group_id: groupsMap.clothing,
        },
        {
            name: 'strap-on dildo',
            slug: 'strap-on-dildo',
            alias_for: null,
        },
        {
            name: 'suspension',
            slug: 'suspension',
            alias_for: null,
        },
        {
            name: 'swallowing',
            slug: 'swallowing',
            alias_for: null,
            group_id: groupsMap.finish,
        },
        {
            name: 'tattoo',
            slug: 'tattoo',
            alias_for: null,
            group_id: groupsMap.body,
        },
        {
            name: 'threesome',
            slug: 'threesome',
            alias_for: null,
            group_id: groupsMap.group,
        },
        {
            name: 'teen',
            slug: 'teen',
            alias_for: null,
            group_id: groupsMap.age,
        },
        {
            name: 'titty fuck',
            slug: 'titty-fuck',
            alias_for: null,
        },
        {
            name: 'toys',
            slug: 'toys',
            alias_for: null,
        },
        {
            name: 'transsexual',
            slug: 'transsexual',
            priority: 10,
            alias_for: null,
        },
        {
            name: 'double anal TP',
            slug: 'da-tp',
            priority: 7,
            description: 'Triple penetration with two cocks in the ass, and one in the pussy. Also see [double vaginal TP](/tag/dv-tp).',
            group_id: groupsMap.penetration,
            alias_for: null,
        },
        {
            name: 'double vaginal TP',
            slug: 'dv-tp',
            priority: 7,
            description: 'Triple penetration with two cocks in the pussy, and one in the ass. Also see [double anal TP](/tag/da-tp).',
            group_id: groupsMap.penetration,
            alias_for: null,
        },
        {
            name: 'triple penetration',
            slug: 'triple-penetration',
            priority: 7,
            description: 'Three cocks fucking her from behind at the same time. This can be either [double anal TP](/tag/da-tp), or [double vaginal TP](/tag/dv-tp).',
            alias_for: null,
        },
        {
            name: 'trimmed',
            slug: 'trimmed',
            alias_for: null,
        },
        {
            name: 'uniform',
            slug: 'uniform',
            alias_for: null,
        },
        {
            name: 'vibrator',
            slug: 'vibrator',
            alias_for: null,
        },
        {
            name: 'voyeur',
            slug: 'voyeur',
            alias_for: null,
        },
        {
            name: 'wet',
            slug: 'wet',
            alias_for: null,
        },
        {
            name: 'caucasian',
            slug: 'caucasian',
            priority: 7,
            alias_for: null,
            group_id: groupsMap.ethnicity,
        },
        {
            name: 'wife',
            slug: 'wife',
            alias_for: null,
        },
        {
            name: 'office',
            slug: 'office',
            alias_for: null,
            group_id: groupsMap.location,
        },
    ];
}

function getTagAliases(tagsMap) {
    return [
        {
            name: '2-on-1',
            alias_for: tagsMap.threesome,
        },
        {
            name: '2 on 1',
            alias_for: tagsMap.threesome,
        },
        {
            name: '3+ on 1',
            alias_for: tagsMap.gangbang,
        },
        {
            name: 'anal sex',
            alias_for: tagsMap.anal,
        },
        {
            name: 'anal gape',
            alias_for: tagsMap.gaping,
        },
        {
            name: 'anilingus',
            alias_for: tagsMap['ass-eating'],
        },
        {
            name: 'asians',
            alias_for: tagsMap.asian,
        },
        {
            name: 'anal fingering',
            alias_for: tagsMap['ass-fingering'],
        },
        {
            name: 'ass licking',
            alias_for: tagsMap['ass-eating'],
        },
        {
            name: 'ass fucking',
            alias_for: tagsMap.anal,
        },
        {
            name: 'atm',
            alias_for: tagsMap['ass-to-mouth'],
        },
        {
            name: 'bald pussy',
            alias_for: tagsMap.shaved,
        },
        {
            name: 'ball gag',
            alias_for: tagsMap.gag,
        },
        {
            name: 'boob fucking',
            alias_for: tagsMap['titty-fuck'],
        },
        {
            name: 'mfm',
            alias_for: tagsMap.mfm,
        },
        {
            name: 'fmf',
            alias_for: tagsMap.mff,
        },
        {
            name: 'ffm',
            alias_for: tagsMap.mff,
        },
        {
            name: 'bgb',
            alias_for: tagsMap.mfm,
        },
        {
            name: 'big ass',
            alias_for: tagsMap['big-butt'],
        },
        {
            name: 'big black cock',
            alias_for: tagsMap.bbc,
        },
        {
            name: 'big black cocks',
            alias_for: tagsMap.bbc,
        },
        {
            name: 'big cocks',
            alias_for: tagsMap['big-dick'],
        },
        {
            name: 'big cock',
            alias_for: tagsMap['big-dick'],
        },
        {
            name: 'big booty',
            alias_for: tagsMap['big-butt'],
        },
        {
            name: 'big butts',
            alias_for: tagsMap['big-butt'],
        },
        {
            name: 'big tits',
            alias_for: tagsMap['big-boobs'],
        },
        {
            name: 'bi',
            alias_for: tagsMap.bisexual,
        },
        {
            name: 'black',
            alias_for: tagsMap.ebony,
        },
        {
            name: 'blonde hair',
            alias_for: tagsMap.blonde,
        },
        {
            name: 'blondes',
            alias_for: tagsMap.blonde,
        },
        {
            name: 'blow job',
            alias_for: tagsMap.blowjob,
        },
        {
            name: 'blowjobs',
            alias_for: tagsMap.blowjob,
        },
        {
            name: 'blowjob pov',
            alias_for: tagsMap.blowjob,
        },
        {
            name: 'blowjob (double)',
            alias_for: tagsMap['double-blowjob'],
        },
        {
            name: 'blowjob - double',
            alias_for: tagsMap['double-blowjob'],
        },
        {
            name: 'blowjob (pov)',
            alias_for: tagsMap.blowjob,
        },
        {
            name: 'blowjob - pov',
            alias_for: tagsMap.blowjob,
        },
        {
            name: 'boob job',
            alias_for: tagsMap['enhanced-boobs'],
        },
        {
            name: 'boobjob',
            alias_for: tagsMap['enhanced-boobs'],
        },
        {
            name: 'brown hair',
            alias_for: tagsMap.brunette,
        },
        {
            name: 'brunettes',
            alias_for: tagsMap.brunette,
        },
        {
            name: 'buttplug',
            alias_for: tagsMap['anal-toys'],
        },
        {
            name: 'butt plug',
            alias_for: tagsMap['anal-toys'],
        },
        {
            name: 'caning',
            alias_for: tagsMap['corporal-punishment'],
        },
        {
            name: 'cattle prod',
            alias_for: tagsMap['electric-shock'],
        },
        {
            name: 'cheer leader',
            alias_for: tagsMap.cheerleader,
        },
        {
            name: 'clover clamps',
            alias_for: tagsMap['nipple-clamps'],
        },
        {
            name: 'couples fantasies',
            alias_for: tagsMap.couples,
        },
        {
            name: 'creampies',
            alias_for: tagsMap.creampie,
        },
        {
            name: 'creampie - anal',
            alias_for: tagsMap['anal-creampie'],
        },
        {
            name: 'crop', // a type of whip, not [sic] short for corporal
            alias_for: tagsMap['corporal-punishment'],
        },
        {
            name: 'cum cleaning',
            alias_for: tagsMap['cum-licking'],
        },
        {
            name: 'cum in mouth',
            alias_for: tagsMap['oral-creampie'],
        },
        {
            name: 'cum on ass',
            alias_for: tagsMap['cum-on-butt'],
        },
        {
            name: 'cum on tits',
            alias_for: tagsMap['cum-on-boobs'],
        },
        {
            name: 'cum swallowing',
            alias_for: tagsMap.swallowing,
        },
        {
            name: 'cum shot',
            alias_for: tagsMap.cumshot,
        },
        {
            name: 'cunnilingus',
            alias_for: tagsMap['pussy-eating'],
        },
        {
            name: 'pussy licking',
            alias_for: tagsMap['pussy-eating'],
        },
        {
            name: 'deep throat',
            alias_for: tagsMap.deepthroat,
        },
        {
            name: 'deepthroating',
            alias_for: tagsMap.deepthroat,
        },
        {
            name: 'dildo',
            alias_for: tagsMap.toys,
        },
        {
            name: 'doggystyle',
            alias_for: tagsMap['doggy-style'],
        },
        {
            name: 'doggy style - pov',
            alias_for: tagsMap['doggy-style'],
        },
        {
            name: 'doggie style',
            alias_for: tagsMap['doggy-style'],
        },
        {
            name: 'doggystyle (standing)',
            alias_for: tagsMap['standing-doggy-style'],
        },
        {
            name: 'doggystyle - standing',
            alias_for: tagsMap['standing-doggy-style'],
        },
        {
            name: 'doggystyle regular',
            alias_for: tagsMap['doggy-style'],
        },
        {
            name: 'dom',
            alias_for: tagsMap.bdsm,
        },
        {
            name: 'domination',
            alias_for: tagsMap.bdsm,
        },
        {
            name: 'dominatrix',
            alias_for: tagsMap.femdom,
        },
        {
            name: 'dp',
            alias_for: tagsMap['double-penetration'],
        },
        {
            name: 'first dp',
            alias_for: tagsMap['double-penetration'],
        },
        {
            name: 'double penetration (dp)',
            alias_for: tagsMap['double-penetration'],
        },
        {
            name: 'double penetration - dp',
            alias_for: tagsMap['double-penetration'],
        },
        {
            name: 'dap',
            alias_for: tagsMap['double-anal'],
        },
        {
            name: 'double anal (dap)',
            alias_for: tagsMap['double-anal'],
        },
        {
            name: 'double anal penetration (dap)',
            alias_for: tagsMap['double-anal'],
        },
        {
            name: 'tap',
            alias_for: tagsMap['triple-anal'],
        },
        {
            name: 'dpp',
            alias_for: tagsMap['double-vaginal'],
        },
        {
            name: 'dvp',
            alias_for: tagsMap['double-vaginal'],
        },
        {
            name: 'double vaginal (dvp)',
            alias_for: tagsMap['double-vaginal'],
        },
        {
            name: 'double vaginal penetration (dvp)',
            alias_for: tagsMap['double-vaginal'],
        },
        {
            name: 'double vaginal (dpp)',
            alias_for: tagsMap['double-vaginal'],
        },
        {
            name: 'double pussy penetration',
            alias_for: tagsMap['double-vaginal'],
        },
        {
            name: 'double pussy penetration (dpp)',
            alias_for: tagsMap['double-vaginal'],
        },
        {
            name: 'drool',
            alias_for: tagsMap.saliva,
        },
        {
            name: 'enhanced',
            alias_for: tagsMap['enhanced-boobs'],
        },
        {
            name: 'enhanced tits',
            alias_for: tagsMap['enhanced-boobs'],
        },
        {
            name: 'facefuck',
            alias_for: tagsMap.facefucking,
        },
        {
            name: 'face fuck',
            alias_for: tagsMap.facefucking,
        },
        {
            name: 'face fucking',
            alias_for: tagsMap.facefucking,
        },
        {
            name: 'face sitting',
            alias_for: tagsMap.facesitting,
        },
        {
            name: 'facial cumshot',
            alias_for: tagsMap.facial,
        },
        {
            name: 'facials',
            alias_for: tagsMap.facial,
        },
        {
            name: 'facial - multiple',
            alias_for: tagsMap.facial,
        },
        {
            name: 'fake boobs',
            alias_for: tagsMap['enhanced-boobs'],
        },
        {
            name: 'fake tits',
            alias_for: tagsMap['enhanced-boobs'],
        },
        {
            name: 'flogging',
            alias_for: tagsMap['corporal-punishment'],
        },
        {
            name: 'foot fetish',
            alias_for: tagsMap.feet,
        },
        {
            name: 'french kissing',
            alias_for: tagsMap.kissing,
        },
        {
            name: 'gape',
            alias_for: tagsMap.gaping,
        },
        {
            name: 'gapes',
            alias_for: tagsMap.gaping,
        },
        {
            name: 'gapes (gaping asshole)',
            alias_for: tagsMap.gaping,
        },
        {
            name: 'group sex',
            alias_for: tagsMap.orgy,
        },
        {
            name: 'flagellation',
            alias_for: tagsMap['corporal-punishment'],
        },
        {
            name: 'huge tits',
            alias_for: tagsMap['big-boobs'],
        },
        {
            name: 'huge toys',
            alias_for: tagsMap.toys,
        },
        {
            name: 'incest',
            alias_for: tagsMap.family,
        },
        {
            name: 'incest fantasy',
            alias_for: tagsMap.family,
        },
        {
            name: 'innie',
            alias_for: tagsMap['innie-pussy'],
        },
        {
            name: 'lashing',
            alias_for: tagsMap['corporal-punishment'],
        },
        {
            name: 'lezdom',
            alias_for: tagsMap.lesbian,
        },
        {
            name: 'mini-skirt',
            alias_for: tagsMap.miniskirt,
        },
        {
            name: 'mmf',
            alias_for: tagsMap.mfm,
        },
        {
            name: 'mature & milf',
            alias_for: tagsMap.milf,
        },
        {
            name: 'natural',
            alias_for: tagsMap['natural-boobs'],
        },
        {
            name: 'natural tits',
            alias_for: tagsMap['natural-boobs'],
        },
        {
            name: 'oral',
            alias_for: tagsMap.blowjob,
        },
        {
            name: 'outie',
            alias_for: tagsMap['outie-pussy'],
        },
        {
            name: 'piercing',
            alias_for: tagsMap.piercings,
        },
        {
            name: 'pierced',
            alias_for: tagsMap.piercings,
        },
        {
            name: 'prolapse',
            alias_for: tagsMap['anal-prolapse'],
        },
        {
            name: 'prolapsing',
            alias_for: tagsMap['anal-prolapse'],
        },
        {
            name: 'raven',
            alias_for: tagsMap['black-hair'],
        },
        {
            name: 'raven hair',
            alias_for: tagsMap['black-hair'],
        },
        {
            name: 'red hair',
            alias_for: tagsMap.redhead,
        },
        {
            name: 'red head',
            alias_for: tagsMap.redhead,
        },
        {
            name: 'rimming',
            alias_for: tagsMap['ass-eating'],
        },
        {
            name: 'rimjob',
            alias_for: tagsMap['ass-eating'],
        },
        {
            name: 'role play',
            alias_for: tagsMap.roleplay,
        },
        {
            name: 'rope bondage',
            alias_for: tagsMap.bondage,
        },
        {
            name: 'rough sex',
            alias_for: tagsMap.rough,
        },
        {
            name: 'school girl',
            alias_for: tagsMap.schoolgirl,
        },
        {
            name: 'sadomasochism',
            alias_for: tagsMap.bdsm,
        },
        {
            name: 'sadism',
            alias_for: tagsMap.bdsm,
        },
        {
            name: 'scissoring',
            alias_for: tagsMap.lesbian,
        },
        {
            name: 'sex toys',
            alias_for: tagsMap.toys,
        },
        {
            name: 'shaved pussy',
            alias_for: tagsMap.shaved,
        },
        {
            name: 'shoes',
            alias_for: tagsMap['shoes-on'],
        },
        {
            name: 'slave',
            alias_for: tagsMap.bdsm,
        },
        {
            name: 'small ass',
            alias_for: tagsMap['small-butt'],
        },
        {
            name: 'small tits',
            alias_for: tagsMap['small-boobs'],
        },
        {
            name: 'spit',
            alias_for: tagsMap.saliva,
        },
        {
            name: 'spitroast',
            alias_for: tagsMap.mfm,
        },
        {
            name: 'standing doggystyle',
            alias_for: tagsMap['standing-doggy-style'],
        },
        {
            name: 'swallow',
            alias_for: tagsMap.swallowing,
        },
        {
            name: 'strap-on',
            alias_for: tagsMap['strap-on-dildo'],
        },
        {
            name: 'strap on',
            alias_for: tagsMap['strap-on-dildo'],
        },
        {
            name: 'strap on dildo',
            alias_for: tagsMap['strap-on-dildo'],
        },
        {
            name: 'sub',
            alias_for: tagsMap.bdsm,
        },
        {
            name: 'submission',
            alias_for: tagsMap.bdsm,
        },
        {
            name: 'tattoos',
            alias_for: tagsMap.tattoo,
        },
        {
            name: 'teens',
            alias_for: tagsMap.teen,
        },
        {
            name: 'throat fucking',
            alias_for: tagsMap.facefucking,
        },
        {
            name: 'tiny boobs',
            alias_for: tagsMap['small-boobs'],
        },
        {
            name: 'tiny tits',
            alias_for: tagsMap['small-boobs'],
        },
        {
            name: 'tittyfuck',
            alias_for: tagsMap['titty-fuck'],
        },
        {
            name: 'tp',
            alias_for: tagsMap['triple-penetration'],
        },
        {
            name: 'trans',
            alias_for: tagsMap.transsexual,
        },
        {
            name: 'transgender',
            alias_for: tagsMap.transsexual,
        },
        {
            name: 'trimmed pussy',
            alias_for: tagsMap.trimmed,
        },
        {
            name: 'ts',
            alias_for: tagsMap.transsexual,
        },
        {
            name: 'whipping',
            alias_for: tagsMap['corporal-punishment'],
        },
        {
            name: 'white',
            alias_for: tagsMap.caucasian,
        },
        {
            name: 'work',
            alias_for: tagsMap.office,
        },
        {
            name: 'workplace',
            alias_for: tagsMap.office,
        },
        {
            name: 'zapper',
            alias_for: tagsMap['electric-shock'],
        },
    ];
}

exports.seed = knex => Promise.resolve()
    .then(async () => upsert('tags_groups', groups, 'slug', knex))
    .then(async () => {
        const groupEntries = await knex('tags_groups').select('*');
        const groupsMap = groupEntries.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});

        const tags = getTags(groupsMap);

        return upsert('tags', tags, 'slug');
    })
    .then(async () => {
        const tags = await knex('tags').select('*').where({ alias_for: null });
        const tagsMap = tags.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});

        const tagAliases = getTagAliases(tagsMap);

        return upsert('tags', tagAliases, 'name');
    });
