User.js (707B)
1 /** 2 * React Starter Kit (https://www.reactstarterkit.com/) 3 * 4 * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 * 6 * This source code is licensed under the MIT license found in the 7 * LICENSE.txt file in the root directory of this source tree. 8 */ 9 10 import DataType from 'sequelize'; 11 import Model from '../sequelize'; 12 13 const User = Model.define('User', { 14 15 id: { 16 type: DataType.UUID, 17 defaultValue: DataType.UUIDV1, 18 primaryKey: true, 19 }, 20 21 email: { 22 type: DataType.STRING(255), 23 validate: { isEmail: true }, 24 }, 25 26 emailConfirmed: { 27 type: DataType.BOOLEAN, 28 defaultValue: false, 29 }, 30 31 }, { 32 33 indexes: [ 34 { fields: ['email'] }, 35 ], 36 37 }); 38 39 export default User;