<commit_before>import config from '../config';
import db from './database';
import Joi from 'joi';

const Users = db.define(
	'Users',
	{
		hashKey: 'userId',
		timestamps: true,
		schema: {
			userId: db.types.uuid(),
			userName: Joi.string(),
			email: Joi.string().email(),
			displayName: Joi.string(),
			passwordHash: Joi.string(),
			role: Joi.string(),
			imageUrl: Joi.string()
		},
		tableName: `divelog-${config.env}-users`,
		indexes: [
			{
				hashKey: 'userName',
				name: 'UserNameIndex',
				type: 'global'
			},
			{
				hashKey: 'email',
				name: 'EmailIndex',
				type: 'global'
			}<commit_msg>Added fields to users table necessary for password reset.<commit_after>import config from '../config';
import db from './database';
import Joi from 'joi';

const Users = db.define(
	'Users',
	{
		hashKey: 'userId',
		timestamps: true,
		schema: {
			userId: db.types.uuid(),
			userName: Joi.string(),
			email: Joi.string().email(),
			displayName: Joi.string(),
			passwordHash: Joi.string(),
			role: Joi.string(),
			imageUrl: Joi.string(),
			passwordResetToken: Joi.string().alphanum().length(16),
			passwordResetExpiration: Joi.string().isoDate()
		},
		tableName: `divelog-${config.env}-users`,
		indexes: [
			{
				hashKey: 'userName',
				name: 'UserNameIndex',
				type: 'global'
			},
			{
				hashKey: 'email',
				name: 'EmailIndex',
				type: 'global'
			}
{'fraction_non_alphanumeric': 0.17397555715312724, 'fraction_numerical': 0.0014378145219266715, 'mean_word_length': 3.336448598130841, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6245760', 'n_tokens_mistral': 588, 'n_tokens_neox': 493, 'n_words': 112}