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)
Thu, Apr 11, 8:50 PM
Unknown Object (File)
Fri, Apr 5, 10:14 PM
Unknown Object (File)
Tue, Apr 2, 4:51 PM
Unknown Object (File)
Sat, Mar 30, 2:47 PM
Unknown Object (File)
Feb 14 2024, 7:15 AM
Unknown Object (File)
Feb 8 2024, 1:58 PM
Unknown Object (File)
Jan 26 2024, 7:42 PM
Unknown Object (File)
Jan 22 2024, 2:45 PM
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.