Restored init db function

* Schema and data operations protected by dev mode