Synchronize tables in the database