Add tests and migrations