Skip to content
  • Yorick Peterse's avatar
    Migrate events into a new format · 20d17d1129f6
    Yorick Peterse authored
    This commit migrates events data in such a way that push events are
    stored much more efficiently. This is done by creating a shadow table
    called "events_for_migration", and a table called "push_event_payloads"
    which is used for storing push data of push events. The background
    migration in this commit will copy events from the "events" table into
    the "events_for_migration" table, push events in will also have a row
    created in "push_event_payloads".
    
    This approach allows us to reclaim space in the next release by simply
    swapping the "events" and "events_for_migration" tables, then dropping
    the old events (now "events_for_migration") table.
    
    The new table structure is also optimised for storage space, and does
    not include the unused "title" column nor the "data" column (since this
    data is moved to "push_event_payloads").
    
    == Newly Created Events
    
    Newly created events are inserted into both "events" and
    "events_for_migration", both using the exact same primary key value. The
    t...
    20d17d1129f6