adds unit tests for attribute.availability and fixes schema to make the tests pass.