Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
created
to group membership model
Add a `created` column to `models.GroupMembership`. While we're doing this, might as well add `updated` as well. There's a desire for this column to be nullable so that pre-existing memberships can have `NULL` in this column, see: https://hypothes-is.slack.com/archives/C4K6M7P5E/p1733330444569829 For that reason we can't use `h.db.mixins.Timestamps` because that mixin adds *non-nullable* `created` and `updated` columns. For the same reason we can't use `server_default` as it would set the pre-existing rows to the current time. I don't think it really matters but if we did change the `GroupMembership` model to inherit from the `Timestamps` mixin that would add the `created` and `updated` columns to the _start_ of the table, whereas in the staging and production DBs a migration is going to add the new columns to the _end_ of the table. Meaning that DBs created from the models (e.g. in dev and on CI) would actually have the columns in a different order than staging and production. Not sure if there would be a way to fix the column order while using `mixins.Timestamps`. Moot point anyway since we need them to be nullable.
- Loading branch information