Added database support
Wrote migrations for the first iteration