fixed updated and deleted document
added index for tables in migration