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

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',
    },
];

const tags = [
    {
        name: '4K',
        slug: '4k',
        description: 'Available in high quality 4K resolution.',
    },
    {
        name: '69',
        slug: '69',
        group: 'position',
    },
    {
        name: 'airtight',
        slug: 'airtight',
        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: 'penetration',
    },
    {
        name: 'amateur',
        slug: 'amateur',
    },
    {
        name: 'anal creampie',
        slug: 'anal-creampie',
        priority: 7,
        description: 'Ejaculating into the asshole.',
        group: 'finish',
    },
    {
        name: 'anal',
        slug: 'anal',
        description: 'Taking a cock in the asshole.',
        priority: 9,
        group: 'penetration',
    },
    {
        name: 'ass fingering',
        slug: 'ass-fingering',
        description: 'Inserting one or multiple fingers into the asshole.',
    },
    {
        name: 'anal fisting',
        slug: 'anal-fisting',
        description: 'Shoving an entire hand into the asshole.',
    },
    {
        name: 'anal prolapse',
        slug: 'anal-prolapse',
    },
    {
        name: 'anal toys',
        slug: 'anal-toys',
        description: 'Stuffing a toy, such as a dildo or buttplug, into the ass',
    },
    {
        name: 'animated',
        slug: 'animated',
    },
    {
        name: 'asian',
        slug: 'asian',
        priority: 7,
        group: 'ethnicity',
    },
    {
        name: 'athletic',
        slug: 'athletic',
        group: '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.',
        group: 'oral',
    },
    {
        name: 'ass eating',
        slug: 'ass-eating',
        group: 'oral',
    },
    {
        name: 'ball licking',
        slug: 'ball-licking',
        group: 'oral',
    },
    {
        name: 'ballerina',
        slug: 'ballerina',
        group: 'roleplay',
    },
    {
        name: 'bathroom',
        slug: 'bathroom',
        group: 'location',
    },
    {
        name: 'BDSM',
        slug: 'bdsm',
        priority: 8,
    },
    {
        name: 'BBC',
        slug: 'bbc',
        group: 'body',
    },
    {
        name: 'big dick',
        slug: 'big-dick',
        group: 'body',
    },
    {
        name: 'big butt',
        slug: 'big-butt',
        group: 'body',
    },
    {
        name: 'big boobs',
        slug: 'big-boobs',
        group: 'body',
    },
    {
        name: 'bisexual',
        slug: 'bisexual',
    },
    {
        name: 'black hair',
        slug: 'black-hair',
        group: 'hair',
    },
    {
        name: 'blonde',
        slug: 'blonde',
        group: 'hair',
    },
    {
        name: 'blowjob',
        slug: 'blowjob',
        priority: 7,
        group: '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).',
        group: 'group',
    },
    {
        name: 'bondage',
        slug: 'bondage',
    },
    {
        name: 'brunette',
        slug: 'brunette',
        group: '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).',
        group: 'finish',
    },
    {
        name: 'casting',
        slug: 'casting',
    },
    {
        name: 'cheerleader',
        slug: 'cheerleader',
        group: 'roleplay',
    },
    {
        name: 'choking',
        slug: 'choking',
    },
    {
        name: 'corporal punishment',
        slug: 'corporal-punishment',
    },
    {
        name: 'couples',
        slug: 'couples',
    },
    {
        name: 'cowgirl',
        slug: 'cowgirl',
    },
    {
        name: 'creampie',
        slug: 'creampie',
        priority: 8,
        description: 'Ejaculalating into her pussy, often shown visibly dripping out afterwards.',
        group: 'finish',
    },
    {
        name: 'cuckold',
        slug: 'cuckold',
    },
    {
        name: 'cum licking',
        slug: 'cum-licking',
    },
    {
        name: 'cum on butt',
        slug: 'cum-on-butt',
    },
    {
        name: 'cum on boobs',
        slug: 'cum-on-boobs',
    },
    {
        name: 'cum swapping',
        slug: 'cum-swapping',
    },
    {
        name: 'cumshot',
        slug: 'cumshot',
    },
    {
        name: 'curvy',
        slug: 'curvy',
    },
    {
        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,
        group: '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,
        group: 'penetration',
    },
    {
        name: 'deepthroat',
        slug: 'deepthroat',
        priority: 7,
        group: 'oral',
    },
    {
        name: 'double penetration',
        slug: 'double-penetration',
        priority: 9,
        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: 'penetration',
    },
    {
        name: 'dungeon',
        slug: 'dungeon',
    },
    {
        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,
        group: 'penetration',
    },
    {
        name: 'double blowjob',
        slug: 'double-blowjob',
        group: 'oral',
    },
    {
        name: 'doggy style',
        slug: 'doggy-style',
        group: 'position',
    },
    {
        name: 'dress',
        slug: 'dress',
        group: 'clothing',
    },
    {
        name: 'ebony',
        slug: 'ebony',
        priority: 7,
        group: 'ethnicity',
    },
    {
        name: 'electric shock',
        slug: 'electric-shock',
    },
    {
        name: 'enhanced boobs',
        slug: 'enhanced-boobs',
    },
    {
        name: 'facefucking',
        slug: 'facefucking',
        priority: 9,
        group: 'oral',
    },
    {
        name: 'facesitting',
        slug: 'facesitting',
        group: 'position',
    },
    {
        name: 'facial',
        slug: 'facial',
        group: 'finish',
    },
    {
        name: 'family taboo',
        slug: 'family',
    },
    {
        name: 'feet',
        slug: 'feet',
    },
    {
        name: 'femdom',
        slug: 'femdom',
    },
    {
        name: 'fingering',
        slug: 'fingering',
    },
    {
        name: 'fisting',
        slug: 'fisting',
    },
    {
        name: 'MFF threesome',
        slug: 'mff',
        priority: 9,
        description: 'A threesome with two women and one guy, in which the women have sex with eachother.',
        group: 'group',
    },
    {
        name: 'gag',
        slug: 'gag',
    },
    {
        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 */
        priority: 9,
        group: 'group',
    },
    {
        name: 'glasses',
        slug: 'glasses',
        group: 'clothing',
    },
    {
        name: 'fake cum',
        slug: 'fake-cum',
        group: '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,
        group: 'group',
    },
    {
        name: 'gaping',
        slug: 'gaping',
    },
    {
        name: 'gay',
        slug: 'gay',
        priority: 10,
    },
    {
        name: 'gonzo',
        slug: 'gonzo',
    },
    {
        name: 'hairy',
        slug: 'hairy',
        group: 'body',
    },
    {
        name: 'handjob',
        slug: 'handjob',
    },
    {
        name: 'hardcore',
        slug: 'hardcore',
    },
    {
        name: 'high heels',
        slug: 'high-heels',
        group: 'clothing',
    },
    {
        name: 'humiliation',
        slug: 'humiliation',
    },
    {
        name: 'innie pussy',
        slug: 'innie-pussy',
    },
    {
        name: 'interracial',
        slug: 'interracial',
        priority: 9,
        group: 'ethnicity',
    },
    {
        name: 'kissing',
        slug: 'kissing',
    },
    {
        name: 'latex',
        slug: 'latex',
    },
    {
        name: 'Latina',
        slug: 'latina',
        priority: 7,
        group: 'ethnicity',
    },
    {
        name: 'leather',
        slug: 'leather',
    },
    {
        name: 'lesbian',
        slug: 'lesbian',
        priority: 9,
    },
    {
        name: 'machine dildo',
        slug: 'machine-dildo',
    },
    {
        name: 'lingerie',
        slug: 'lingerie',
        group: 'clothing',
    },
    {
        name: 'live',
        slug: 'live',
    },
    {
        name: 'maid',
        slug: 'maid',
        group: 'roleplay',
    },
    {
        name: 'massage',
        slug: 'massage',
    },
    {
        name: 'masturbation',
        slug: 'masturbation',
    },
    {
        name: 'MILF',
        slug: 'milf',
        priority: 7,
        group: '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.',
        group: 'group',
    },
    {
        name: 'miniskirt',
        slug: 'miniskirt',
        group: 'clothing',
    },
    {
        name: 'missionary',
        slug: 'missionary',
        group: 'position',
    },
    {
        name: 'natural boobs',
        slug: 'natural-boobs',
        group: 'body',
    },
    {
        name: 'nipple clamps',
        slug: 'nipple-clamps',
    },
    {
        name: 'oil',
        slug: 'oil',
    },
    {
        name: 'oral creampie',
        slug: 'oral-creampie',
        priority: 7,
        group: '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).',
        group: 'group',
    },
    {
        name: 'outdoors',
        slug: 'outdoors',
        group: 'location',
    },
    {
        name: 'outie pussy',
        slug: 'outie-pussy',
    },
    {
        name: 'pain',
        slug: 'pain',
    },
    {
        name: 'parody',
        slug: 'parody',
    },
    {
        name: 'pegging',
        slug: 'pegging',
    },
    {
        name: 'petite',
        slug: 'petite',
    },
    {
        name: 'piercings',
        slug: 'piercings',
    },
    {
        name: 'POV',
        slug: 'pov',
    },
    {
        name: 'pussy eating',
        slug: 'pussy-eating',
        group: 'oral',
    },
    {
        name: 'redhead',
        slug: 'redhead',
        group: 'hair',
    },
    {
        name: 'reverse cowgirl',
        slug: 'reverse-cowgirl',
    },
    {
        name: 'roleplay',
        slug: 'roleplay',
    },
    {
        name: 'rough',
        slug: 'rough',
        priority: 7,
    },
    {
        name: 'saliva',
        slug: 'saliva',
    },
    {
        name: 'schoolgirl',
        slug: 'schoolgirl',
        group: 'roleplay',
    },
    {
        name: 'shaved',
        slug: 'shaved',
    },
    {
        name: 'shoes on',
        slug: 'shoes-on',
        group: 'clothing',
    },
    {
        name: 'short hair',
        slug: 'short-hair',
        group: 'hair',
    },
    {
        name: 'skirt',
        slug: 'skirt',
        group: 'clothing',
    },
    {
        name: 'slapping',
        slug: 'slapping',
    },
    {
        name: 'sloppy blowjob',
        slug: 'sloppy-blowjob',
    },
    {
        name: 'socks',
        slug: 'socks',
        group: 'clothing',
    },
    {
        name: 'solo',
        slug: 'solo',
    },
    {
        name: 'spanking',
        slug: 'spanking',
    },
    {
        name: 'spooning',
        slug: 'spooning',
        group: 'position',
    },
    {
        name: 'strapon',
        slug: 'strapon',
    },
    {
        name: 'small boobs',
        slug: 'small-boobs',
    },
    {
        name: 'small butt',
        slug: 'small-butt',
    },
    {
        name: 'speculum',
        slug: 'speculum',
    },
    {
        name: 'squirting',
        slug: 'squirting',
    },
    {
        name: 'standing doggy style',
        slug: 'standing-doggy-style',
    },
    {
        name: 'stockings',
        slug: 'stockings',
        group: 'clothing',
    },
    {
        name: 'strap-on dildo',
        slug: 'strap-on-dildo',
    },
    {
        name: 'suspension',
        slug: 'suspension',
    },
    {
        name: 'swallowing',
        slug: 'swallowing',
        group: 'finish',
    },
    {
        name: 'tattoo',
        slug: 'tattoo',
        group: 'body',
    },
    {
        name: 'teacher',
        slug: 'teacher',
        group: 'roleplay',
    },
    {
        name: 'threesome',
        slug: 'threesome',
        group: 'group',
    },
    {
        name: 'teen',
        slug: 'teen',
        group: 'age',
    },
    {
        name: 'titty fuck',
        slug: 'titty-fuck',
    },
    {
        name: 'toys',
        slug: 'toys',
    },
    {
        name: 'transsexual',
        slug: 'transsexual',
        priority: 10,
    },
    {
        name: 'DA triple penetration',
        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: 'penetration',
    },
    {
        name: 'DV triple penetration',
        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: 'penetration',
    },
    {
        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).',
    },
    {
        name: 'trimmed',
        slug: 'trimmed',
    },
    {
        name: 'uniform',
        slug: 'uniform',
    },
    {
        name: 'vibrator',
        slug: 'vibrator',
    },
    {
        name: 'voyeur',
        slug: 'voyeur',
    },
    {
        name: 'wet',
        slug: 'wet',
    },
    {
        name: 'caucasian',
        slug: 'caucasian',
        priority: 7,
        group: 'ethnicity',
    },
    {
        name: 'wife',
        slug: 'wife',
    },
    {
        name: 'office',
        slug: 'office',
        group: 'location',
    },
];

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

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

        const tagAliases = aliases.map(alias => ({
            name: alias.name,
            alias_for: tagsMap[alias.for],
        }));

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