- Change the way modules are autodiscovered (use Django utility). It should work now with new style apps.
- Added index on the
stored_entity_id
field which fixes performance issue when there are many events. It requires migration, version change reflects that.
- Switched to
schema_version = None
default when deserializing events withoutschema_version
.
- Stopped overriding
schema_version
if it exists. - Started passing all event attributes to event constructor during
deserialization. This allows to handle event structure migration
("upcasting") in each event's constructor: one can modify
kwargs
before callingsuper().__init__
.
- Made
@abstract
non inheritable: now only classes explicitly marked with the@abstract
decorator are abstract. Their subclasses are not. This was always the intended behavior.
-
Switched to adding
schema_version
to event objects themselves instead of just transcoded events. This way events will pass validation if their Avro schemas requireschema_version
. -
Renamed setting responsible for the above feature from
EVENT_TRANSCODER.ADDS_EVENT_VERSION_TO_DATA
toADDS_SCHEMA_VERSION_TO_EVENT_DATA
.
- Renamed
Event.schema_version
toEvent.version
. - Started setting
Event.version
based on schema file with the highest number. - Added event version to stored event envelope under the
event_version
key. - Added setting to add event version to event data as well (see "Event version" section in README).
-
Started automatically choosing Avro schemas with the highest version (based on file names on disk).
-
Changed way how event type string is computed. For example, given User aggregate and Created event, now it would be "user_created" (while in older versions that would be simply "Created" which sometimes is not sufficient enough). Moreover it is now possible to override that with
event_type
attribute set on an event class.
- Made
DomainEvent.metadata
optional during serialization (PR #10).
- Fixed exception when DomainEvent.metadata is not defined on saving to event store. PR#7
- When attempt to create an aggregate using ID of existing one,
esdjango.exceptions.AlreadyExists
error would be raised. NOTE: This is possibly a breaking change: previously Django's standard IntegrityError was raised.