fix: seed user data column name (#87)
This commit is contained in:
@@ -22,5 +22,5 @@ module.exports = {
|
||||
* Example:
|
||||
* await queryInterface.dropTable('users');
|
||||
*/
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
* @returns
|
||||
*/
|
||||
function defineUser(sequelize, DataTypes) {
|
||||
const User = sequelize.define('User', {
|
||||
const User = sequelize.define(
|
||||
'User',
|
||||
{
|
||||
email: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
@@ -26,7 +28,9 @@ function defineUser(sequelize, DataTypes) {
|
||||
avatarPath: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
}, { underscored: true });
|
||||
},
|
||||
{ underscored: true }
|
||||
);
|
||||
|
||||
User.associate = (models) => {
|
||||
User.hasMany(models.Project, { foreignKey: 'userId' });
|
||||
|
||||
@@ -13,72 +13,72 @@ module.exports = {
|
||||
password: hashedPassword,
|
||||
username: 'Admin',
|
||||
role: 0,
|
||||
avatarPath: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
avatar_path: null,
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
},
|
||||
{
|
||||
email: 'samuel@example.com',
|
||||
password: hashedPassword,
|
||||
username: 'Samuel Golden',
|
||||
role: 1,
|
||||
avatarPath: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
avatar_path: null,
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
},
|
||||
{
|
||||
email: 'trey@example.com',
|
||||
password: hashedPassword,
|
||||
username: 'Trey Fisher',
|
||||
role: 1,
|
||||
avatarPath: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
avatar_path: null,
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
},
|
||||
{
|
||||
email: 'zoe@example.com',
|
||||
password: hashedPassword,
|
||||
username: 'Zoe Woodward',
|
||||
role: 1,
|
||||
avatarPath: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
avatar_path: null,
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
},
|
||||
{
|
||||
email: 'roger@example.com',
|
||||
password: hashedPassword,
|
||||
username: 'Roger Hess',
|
||||
role: 1,
|
||||
avatarPath: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
avatar_path: null,
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
},
|
||||
{
|
||||
email: 'jasmine@example.com',
|
||||
password: hashedPassword,
|
||||
username: 'Jasmine Moody',
|
||||
role: 1,
|
||||
avatarPath: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
avatar_path: null,
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
},
|
||||
{
|
||||
email: 'tatsuya@example.com',
|
||||
password: hashedPassword,
|
||||
username: 'Suzuki Tatsuya',
|
||||
role: 1,
|
||||
avatarPath: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
avatar_path: null,
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
},
|
||||
{
|
||||
email: 'eri@example.com',
|
||||
password: hashedPassword,
|
||||
username: 'Sato Eri',
|
||||
role: 1,
|
||||
avatarPath: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
avatar_path: null,
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user