Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-3234

Add "updated_at" column in the table "billable_usage_remittance"

XMLWordPrintable

      This new column is of type timestamp and nullable. It needs to be updated with now() every time we create/update a remittance entity.
      For doing this, we can use the "@PrePersist" and "@PreUpdate" annotations like:

      @PreUpdate @PrePersist
        public void prePersist() {
          this.updatedAt = OffsetDateTime.now(ZoneId.of("UTC"));
        }
      

      We don't need to update the existing records.
      About tests, we can assert that the new records contain the updated_at column with a timestamp populated.

              jcarvaja@redhat.com Jose Carvajal Hilario
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: