fix the bug of database migrate