Page MenuHomePhabricator

Convert storage for Herald repetition policy to "text32"
ClosedPublic

Authored by epriestley on Jan 25 2018, 4:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 4:31 PM
Unknown Object (File)
Sat, Nov 16, 7:37 PM
Unknown Object (File)
Thu, Nov 14, 4:05 AM
Unknown Object (File)
Thu, Oct 24, 10:35 PM
Unknown Object (File)
Thu, Oct 24, 8:31 PM
Unknown Object (File)
Oct 16 2024, 3:19 PM
Unknown Object (File)
Oct 15 2024, 6:39 PM
Unknown Object (File)
Oct 12 2024, 5:34 AM
Subscribers
None

Details

Summary

Depends on D18926. Ref T6203. Ref T13048. Herald rule repetition policies are stored as integers but treated as strings in most contexts.

After D18926, the integer stuff is almost totally hidden inside HeraldRule and getting rid of it completely isn't too tricky.

Do so now.

Test Plan
  • Created "only the first time" and "every time" rules. Did a SELECT on their rows in the database.
  • Ran migrations, got a clean bill of health from storage adjust.
  • Did another SELECT on the rows, saw a faithful conversion to strings "every" and "first".
  • Edited and reviewed rules, swapping them between "every" and "first".

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley created this revision.
  • Rename "herlad" migration to "herald".
amckinley added inline comments.
resources/sql/autopatches/20180124.herald.01.repetition.sql
2–5

Shouldn't SQL comments be either /* */-style or start with a leading --? Looks like the syntax highlighter is confused as well.

This revision is now accepted and ready to land.Jan 25 2018, 7:12 PM

I think the highlighter just implements an incomplete ruleset, since the MySQL documentation says this is OK and even lists it first:

Screen Shot 2018-01-25 at 11.17.18 AM.png (157×390 px, 19 KB)

Admittedly, these aren't super common. One soft argument for # is maybe that /* ... */ has tons and tons of spooky behavior where it's used to hide parts of statements from different versions of MySQL, and I think the degenerate form /*! .. */ is a special comment which means "this is not a comment".

I think we use /* more often though so I'll swap 'em.

  • For consistency, use more standard SQL comment style.
This revision was automatically updated to reflect the committed changes.