0228__fix_blobIds.sql 812 B

1234567891011121314151617
  1. -- + is normally replaced by X and / by Y, but this can temporarily cause UNIQUE key exception
  2. -- this might create blob duplicates, but cleanup will eventually take care of it
  3. UPDATE blobs SET blobId = REPLACE(blobId, '+', 'A');
  4. UPDATE blobs SET blobId = REPLACE(blobId, '/', 'B');
  5. UPDATE notes SET blobId = REPLACE(blobId, '+', 'A');
  6. UPDATE notes SET blobId = REPLACE(blobId, '/', 'B');
  7. UPDATE attachments SET blobId = REPLACE(blobId, '+', 'A');
  8. UPDATE attachments SET blobId = REPLACE(blobId, '/', 'B');
  9. UPDATE revisions SET blobId = REPLACE(blobId, '+', 'A');
  10. UPDATE revisions SET blobId = REPLACE(blobId, '/', 'B');
  11. UPDATE entity_changes SET entityId = REPLACE(entityId, '+', 'A') WHERE entityName = 'blobs';
  12. UPDATE entity_changes SET entityId = REPLACE(entityId, '/', 'B') WHERE entityName = 'blobs';