-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Present and persist updatedAt and createdAt in meta (#16)
* When fetching a version or entity, populate entity.meta with updatedAt and createdAt based on entity_version created and entity entity_created as well as correlationId from entity_version correlation_id overriding persistd data in order to not display faulty dates for old objects persited with the user supplied createdAt and/or updatedAt. * When upserting an entity, ignore user specified updatedAt and createdAt as they will not be used and set the actual updatedAt and createdAt on the supplied entity object before persisting. I.e. updatedAt = now and createdAt = now or when the entity was created if it already exists. * Change all timestamp fields to use timestamp with tz * Changed port for pg instance to 5435 to now clash with other running instances when testing.
- Loading branch information
Showing
9 changed files
with
165 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE entity ALTER entity_created TYPE timestamptz USING entity_created AT TIME ZONE 'UTC', ALTER entity_removed TYPE timestamptz USING entity_removed AT TIME ZONE 'UTC', ALTER COLUMN entity_created SET DEFAULT now() at time zone 'utc'; | ||
ALTER TABLE entity_version ALTER created TYPE timestamptz USING created AT TIME ZONE 'UTC', ALTER COLUMN created SET DEFAULT now() at time zone 'utc'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.