Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Clean up schema for event_edges #12893

Merged
merged 9 commits into from
Jun 15, 2022
Merged

Clean up schema for event_edges #12893

merged 9 commits into from
Jun 15, 2022

Commits on May 27, 2022

  1. Remove redundant references to event_edges.room_id

    We don't need to care about the room_id here, because we are already checking
    the event id.
    richvdh committed May 27, 2022
    Configuration menu
    Copy the full SHA
    eaa47cf View commit details
    Browse the repository at this point in the history
  2. Clean up the event_edges table

    We make a number of changes to `event_edges`:
    
     * We give the `room_id` and `is_state` columns defaults (null and false
       respectively) so that we can stop populating them.
     * We drop any rows that have `is_state` set true - they should no longer
       exist.
     * We drop any rows that do not exist in `events` - these should not exist
       either.
     * We drop the old unique constraint on all the colums, which wasn't much use.
     * We create a new unique index on `(event_id, prev_event_id)`.
     * We add a foreign key constraint to `events`.
    
    These happen rather differently depending on whether we are on Postgres or
    SQLite. For SQLite, we just rebuild the whole table, copying only the rows we
    want to keep. For Postgres, we try to do things in the background as much as
    possible.
    richvdh committed May 27, 2022
    Configuration menu
    Copy the full SHA
    4bc172f View commit details
    Browse the repository at this point in the history
  3. Stop populateing event_edges.room_id and is_state

    We can just rely on the defaults.
    richvdh committed May 27, 2022
    Configuration menu
    Copy the full SHA
    9c70e88 View commit details
    Browse the repository at this point in the history
  4. changelog

    richvdh committed May 27, 2022
    Configuration menu
    Copy the full SHA
    d885adc View commit details
    Browse the repository at this point in the history

Commits on May 30, 2022

  1. Add a comment

    richvdh committed May 30, 2022
    Configuration menu
    Copy the full SHA
    aa3a170 View commit details
    Browse the repository at this point in the history
  2. remove spurious newlines

    richvdh committed May 30, 2022
    Configuration menu
    Copy the full SHA
    b301385 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2022

  1. Configuration menu
    Copy the full SHA
    62861e6 View commit details
    Browse the repository at this point in the history
  2. bump SCHEMA_COMPAT_VERSION

    richvdh committed Jun 1, 2022
    Configuration menu
    Copy the full SHA
    c074c49 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2022

  1. Configuration menu
    Copy the full SHA
    f7607e9 View commit details
    Browse the repository at this point in the history