Fix notification metadata field name in migration to ensure proper updates

This commit is contained in:
Mo Tarbin 2025-03-17 01:08:58 -04:00
parent cdcde095dd
commit 25d4fbfc1d

View file

@ -28,7 +28,7 @@ func (m MigrateFixNotificationMetadataExperimentModal20241212) Up(ctx context.Co
return db.Transaction(func(tx *gorm.DB) error {
// Update all chore where notification metadata is a null stirng 'null' to empty json {}:
if err := tx.Table("chores").Where("notification_metadata = ?", "null").Update("notification_metadata", "{}").Error; err != nil {
if err := tx.Table("chores").Where("notification_meta = ?", "null").Update("notification_meta", "{}").Error; err != nil {
log.Errorf("Failed to update chores with null notification metadata: %v", err)
return err
}