rewrite database as code first