• Julien Muchembled's avatar
    CMFActivity: better date ordering by using micro-precision · 0b3aecff
    Julien Muchembled authored
    Originally, uids somehow sorted messages by date of insertion, in particular
    for those that were created within the same second. But since random uids,
    such messages became validated or processed in random order.
    
    Note however that by default, messages created in the same transaction all have
    exactly the same date, so commit a42da4de
    ("CMFActivity: Do not use offset for scanning messages to validate.")
    forces us to keep the ordering on uids (in addition to priority/date).
    
    Existing instances will upgrade automatically, using the already existing code
    to upgrade tables in a generic way. You should see the following logs:
    
      INFO CMFActivity 'message_queue' table upgraded
      ALTER TABLE message_queue
        MODIFY COLUMN date datetime(6) NOT NULL AFTER uid,
        MODIFY COLUMN processing_date datetime(6) DEFAULT NULL AFTER processing
      INFO CMFActivity 'message_job' table upgraded
      ALTER TABLE message_job
        MODIFY COLUMN date datetime(6) NOT NULL AFTER uid,
        MODIFY COLUMN processing_date datetime(6) DEFAULT NULL AFTER processing
      INFO CMFActivity 'message' table upgraded
      ALTER TABLE message
        MODIFY COLUMN date datetime(6) NOT NULL AFTER uid,
        MODIFY COLUMN processing_date datetime(6) DEFAULT NULL AFTER processing
    0b3aecff
SQLBase.py 33.3 KB