Newly created database is now identified by flag

Newly created database is now identified by flag instead of looking if the version number is 0