moves source directory to main
adds indexes to foreign keys on relationships