add migration command, update admin, fix bugs, add unique indexes