Unlike snapshot_files and snapshot_blobs which have ON DELETE CASCADE, the uploads FK does not cascade. This means deleting a snapshot without first deleting its uploads will fail with a FK violation (if FK enforcement is on). The code works around this by manually deleting uploads first in deleteSnapshotFromLocalDB, but syncWithRemote does NOT do this cleanup.
In `schema.sql`, the `uploads` table has:
```sql
FOREIGN KEY (snapshot_id) REFERENCES snapshots(id)
```
Unlike `snapshot_files` and `snapshot_blobs` which have `ON DELETE CASCADE`, the `uploads` FK does not cascade. This means deleting a snapshot without first deleting its uploads will fail with a FK violation (if FK enforcement is on). The code works around this by manually deleting uploads first in `deleteSnapshotFromLocalDB`, but `syncWithRemote` does NOT do this cleanup.
Ref: parent issue #1
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In
schema.sql, theuploadstable has:Unlike
snapshot_filesandsnapshot_blobswhich haveON DELETE CASCADE, theuploadsFK does not cascade. This means deleting a snapshot without first deleting its uploads will fail with a FK violation (if FK enforcement is on). The code works around this by manually deleting uploads first indeleteSnapshotFromLocalDB, butsyncWithRemotedoes NOT do this cleanup.Ref: parent issue #1