dcallagh / waiverdb

Forked from waiverdb 7 years ago
Clone

9b6e24b avoid JSONB column type

Authored and Committed by Dan Callaghan 6 years ago
    avoid JSONB column type
    
    We want to stay compatible with Postgres 9.2 which lacks the JSONB
    column type.
    
    We can use the older JSON column type instead, but it needs some extra
    massaging to allow equality comparisons across JSON values. (JSONB
    handles this itself.)
    
    The short version is: we compare JSON values as strings, which means we
    also need to ensure the string serialization is always consistent when
    we send it to the database. The sort_keys=True argument to JSONEncoder()
    gives us that.
    
    Fixes #134.
    
        
file modified
+3 -3
file modified
+13 -1
file modified
+22 -5