Fixed sqlite db dir ownership and creating migrations on fresh installs