<commit_before>const moment = require('moment');

const config = require('../config');

module.exports = Sequelize => ({
  name: 'child',
  fields: {
    id: {
      autoIncrement: true,
      primaryKey: true,
      type: Sequelize.INTEGER
    },
    name_first: {
      type: Sequelize.STRING,
      allowNull: false
    },
    name_middle: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    name_last: {
      type: Sequelize.STRING,
      allowNull: false
    },
    dob: {
      type: Sequelize.DATE,
      allowNull: false,
      encrypt: true,
      get() {
        const dob = this.getDataValue('dob');

        return moment(dob).format('YYYY-MM-DD');
      }
    },
    race: {
      type: Sequelize.ENUM,
      values: config.raceOptions,
      defaultValue: null
    },
    last4ssn: {
      type: Sequelize.STRING,
      allowNull: false,
      encrypt: true
    },
    free_or_reduced_lunch: {
      type: Sequelize.BOOLEAN,
      allowNull: false
    },
    reason_for_nomination: {
      type: Sequelize.STRING,
      allowNull: false
    },
    school_id: {
      type: Sequelize.INTEGER,
      defaultValue: null
    },
    bike_want: {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: false
    },
    bike_size: {
      type: Sequelize.ENUM,
      values: config.bikeSizes,
      defaultValue: null
    },
    bike_style: {
      type: Sequelize.ENUM,
      values: config.bikeStyles,
      defaultValue: null
    },
    clothes_want: {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: false
    },
    clothes_size_shirt: {
      type: Sequelize.ENUM,
      values: config.clothesSizes,
      defaultValue: null
    },
    clothes_size_pants: {
      type: Sequelize.ENUM,
      values: config.clothesSizes,
      defaultValue: null
    },
    shoe_size: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    favourite_colour: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    interests: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    additional_ideas: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    gender: {
      type: Sequelize.ENUM,
      values: config.genders,
      defaultValue: null
    },
    age: {
      type: Sequelize.VIRTUAL,
      get: function () {
        return moment().diff(this.dob, 'years');
      }
    },
    name_full: {<commit_msg>Drop enums for strings in child and household table<commit_after>const moment = require('moment');

const config = require('../config');

module.exports = Sequelize => ({
  name: 'child',
  fields: {
    id: {
      autoIncrement: true,
      primaryKey: true,
      type: Sequelize.INTEGER
    },
    name_first: {
      type: Sequelize.STRING,
      allowNull: false
    },
    name_middle: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    name_last: {
      type: Sequelize.STRING,
      allowNull: false
    },
    dob: {
      type: Sequelize.DATE,
      allowNull: false,
      encrypt: true,
      get() {
        const dob = this.getDataValue('dob');

        return moment(dob).format('YYYY-MM-DD');
      }
    },
    race: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    last4ssn: {
      type: Sequelize.STRING,
      allowNull: false,
      encrypt: true
    },
    free_or_reduced_lunch: {
      type: Sequelize.BOOLEAN,
      allowNull: false
    },
    reason_for_nomination: {
      type: Sequelize.STRING,
      allowNull: false
    },
    school_id: {
      type: Sequelize.INTEGER,
      defaultValue: null
    },
    bike_want: {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: false
    },
    bike_size: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    bike_style: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    clothes_want: {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: false
    },
    clothes_size_shirt: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    clothes_size_pants: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    shoe_size: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    favourite_colour: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    interests: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    additional_ideas: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    gender: {
      type: Sequelize.STRING,
      defaultValue: null
    },
    age: {
      type: Sequelize.VIRTUAL,
      get: function () {
        return moment().diff(this.dob, 'years');
      }
    },
    name_full: {
{'fraction_non_alphanumeric': 0.11198637428145625, 'fraction_numerical': 0.0004258037044922291, 'mean_word_length': 1.998085513720485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4974282', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1577, 'n_words': 302}