hunk.code_window:             console.log(
                   chalk.green("Schema synchronization finished successfully."),
               )
           } catch (err) {
               if (dataSource) await dataSource.destroy()
  
hunk.labels: keep keep keep add keep keep
hunk.after_edit:             PlatformTools.logCmdErr("Error during schema synchronization:", err)
  
hunk.file_path: src/commands/SchemaSyncCommand.ts
hunk.type: add
file: import {
      EntitySubscriberInterface,
      EventSubscriber,
      LoadEvent,
      UpdateEvent,
  } from "../../../../src"
  import { Setting } from "./Setting"
  
  @EventSubscriber()
  export class SettingSubscriber implements EntitySubscriberInterface {
      counter: any
  
      constructor() {
          this.reset()
      }
  
      listenTo() {
          return Setting
      }
  
      afterLoad(item: Setting, event?: LoadEvent<Setting>) {
          // just an example, any entity modification on after load will lead to this issue
          item.value = "x"
      }
  
      beforeUpdate(event: UpdateEvent<any>): void {
          this.counter.updates++
      }
  
      beforeInsert(event: UpdateEvent<any>): void {
          this.counter.inserts++
      }
  
      beforeRemove(event: UpdateEvent<any>): void {
          this.counter.deletes++
      }
  
      reset() {
          this.counter = {
              deletes: 0,
              inserts: 0,
              updates: 0,
          }
      }
  }
  