Skip to content

Improves add_timestamps_with_timezone helper

Alex Kalderimis requested to merge improve-add-timestamps into master

What does this MR do?

This improves the add_timestamps_with_timezone migration helper method, by making the columns configurable. It also improves the tests, and adds a down helper for timezone columns.

Currently, in the interests of conservatism, the set of valid timezone columns is treated as a closed set of {:created_at, :updated_at, :deleted_at}. One could imagine that set being extended, or being more liberal by accepting all column names that match a regular expression. That is left for future discussion.

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

This does not pose any new performance risks.

New tests have been added to cover the new functionality, and test for expected error cases.

Edited by Mayra Cabrera

Merge request reports