Skip to content

Use timestamps instead of booleans #18

@Sporiff

Description

@Sporiff

Boolean values are often unnecessary if an action timestamp conveys the information. For example, we currently use a boolean isSubscribed field on subscriptions to convey whether the subscription is active. Instead, an unsubscribedAt timestamp would convey more information:

  • If it's present, the user is unsubscribed
  • If it's not present, the user is subscribed
  • The updatedAt and unsubscribedAt fields can convey different information (the unsubscribedAt timestamp is a definite action taken at a specific time, the updatedAt value is updated whenever a record changes).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions