fix(user): persist updateUser correctly; add setup:api script and README update; seeders tweaks

This commit is contained in:
2025-12-05 01:33:38 +01:00
parent bd263c01b9
commit b710b34569
20 changed files with 1637 additions and 53 deletions
@@ -8,7 +8,7 @@ module.exports = {
// Create User table
await queryInterface.createTable('user', {
id: {
type: Sequelize.STRING(24),
type: Sequelize.STRING(36),
allowNull: false,
primaryKey: true
},
@@ -202,7 +202,7 @@ module.exports = {
allowNull: false
},
authorId: {
type: Sequelize.STRING(24),
type: Sequelize.STRING(36),
allowNull: true,
references: {
model: 'user',
@@ -236,7 +236,7 @@ module.exports = {
allowNull: false
},
authorId: {
type: Sequelize.STRING(24),
type: Sequelize.STRING(36),
allowNull: true,
references: {
model: 'user',
@@ -306,7 +306,7 @@ module.exports = {
// Create Favorite table (junction table for User-Article)
await queryInterface.createTable('favorite', {
userId: {
type: Sequelize.STRING(24),
type: Sequelize.STRING(36),
allowNull: false,
primaryKey: true,
references: {
@@ -342,7 +342,7 @@ module.exports = {
// Create Follower table (junction table for User-User)
await queryInterface.createTable('follower', {
userId: {
type: Sequelize.STRING(24),
type: Sequelize.STRING(36),
allowNull: false,
primaryKey: true,
references: {
@@ -353,7 +353,7 @@ module.exports = {
onUpdate: 'CASCADE'
},
followerId: {
type: Sequelize.STRING(24),
type: Sequelize.STRING(36),
allowNull: false,
primaryKey: true,
references: {
@@ -437,7 +437,7 @@ module.exports = {
onUpdate: 'CASCADE'
},
ownerId: {
type: Sequelize.STRING(24),
type: Sequelize.STRING(36),
allowNull: true,
references: {
model: 'user',
@@ -471,7 +471,7 @@ module.exports = {
// Create UserRoleXref table (junction table for User-Role)
await queryInterface.createTable('userRoleXref', {
userId: {
type: Sequelize.STRING(24),
type: Sequelize.STRING(36),
allowNull: false,
primaryKey: true,
references: {