fix(scripts): use mysql.js registry in create-user instead of deleted barrel
This commit is contained in:
+1
-24
@@ -116,31 +116,8 @@ const createUser = async () => {
|
||||
await sequelize.authenticate();
|
||||
console.log('✅ Connexion établie\n');
|
||||
|
||||
// Initialize all models by calling their functions
|
||||
const rawDB = require('../src/database/models/mysql');
|
||||
|
||||
// Call each model function to initialize it
|
||||
rawDB.User();
|
||||
rawDB.Role();
|
||||
rawDB.Article();
|
||||
rawDB.Tag();
|
||||
rawDB.TagList();
|
||||
rawDB.UserRoleXref();
|
||||
rawDB.Follower();
|
||||
rawDB.Favorite();
|
||||
rawDB.Comment();
|
||||
rawDB.Brand();
|
||||
rawDB.Category();
|
||||
rawDB.Packaging();
|
||||
rawDB.Product();
|
||||
rawDB.ProductCategoryXref();
|
||||
rawDB.ProductTagXref();
|
||||
|
||||
// Also initialize relationships
|
||||
const DB = require('../src/database/mysql');
|
||||
require('../src/database/relationships')();
|
||||
|
||||
// Get the initialized models from sequelize
|
||||
const DB = sequelize.models;
|
||||
|
||||
// Hash password with same algorithm as UserService
|
||||
const { salt, hash } = hashPassword(password);
|
||||
|
||||
Reference in New Issue
Block a user