We check for compatibility by specifying a schema version and minimum schema version in the code, storing them in the DB, and checking whether the DB is too old for the code or vice versa.